Class: Validaform::FormsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Validaform::FormsController
- Defined in:
- app/controllers/validaform/forms_controller.rb
Instance Method Summary collapse
-
#validate ⇒ Object
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.
Instance Method Details
#validate ⇒ Object
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 |