Class: PicoPhone::Rails::ValidationsController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
lib/pico_phone/rails/validations_controller.rb

Overview

region: always arrives as an already-resolved String -- no record lookup.

Instance Method Summary collapse

Instance Method Details

#validateObject



9
10
11
12
13
14
# File 'lib/pico_phone/rails/validations_controller.rb', line 9

def validate
  phone = params[:phone].to_s
  return render json: { valid: false, blank: true } if phone.strip.empty?

  render json: response_for(phone, params[:region].presence)
end