Class: Validaform::FormsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/validaform/forms_controller.rb

Instance Method Summary collapse

Instance Method Details

#validateObject

curl -X POST -H ‘Content-Type: application/json’ -d \ ‘“fields”:[{“name”:“users/first_name”,“value”:“Asterix”, “name”:“users/last_name”,“value”:“LeGaulois”, “value”:“17”]}’ \ localhost:3000/validaform/forms/validate



10
11
12
13
# File 'app/controllers/validaform/forms_controller.rb', line 10

def validate
  validator = Validaform::Base.new(params: params)
  render json: validator.errors, status: validator.status_code
end