Closed andresgutgon closed 8 years ago
I would fix the error instead. I think that this is one of those cases where parameters validation in controllers is useful.
I would fix the error instead
How?
You can catch the error and respond with whatever you want in the controller
Can you point to an example on how to catch that error?
ActionController::ParameterMissing
is the exception raised.
you can use rescue_from
inside the controller to add custom behavior http://guides.rubyonrails.org/action_controller_overview.html#rescue-from
Really nice @edulan && @andresgutgon ! :clap: :+1:
WAT
Not necessary validate presence of
emails
on that layer. Already validated later. Also validating in that moment do not return the error for UI: