You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 28, 2024. It is now read-only.
when you file a request rather than do a normal save it doesn't seem like model validation errors display in the form.
i handled this with the code below, but i'm not sure it's the best solution or if it's handling all possible errors. would be good to address this in the docs!
def create
@service = current_user.organisation.services.build(service_params)
if @service.valid?
current_user.request_for_create(@service, reason: "something").save
redirect_to organisations_path, notice: "Your service has been submitted for review. You'll be emailed when it's approved."
else
render "new"
end
end
when you file a request rather than do a normal save it doesn't seem like model validation errors display in the form.
i handled this with the code below, but i'm not sure it's the best solution or if it's handling all possible errors. would be good to address this in the docs!