Skip to content

Stay on the same route if form submission failed #132

You must be logged in to vote

devise_for :users,
controllers: { registrations: 'users/registrations'}
The above code creates one of the routes as POST "/users" for create_user. When the for submits even if it fails, the page will redirect to this route.

To override the above route, custom routes were created for user registration, so the form will submit to the current route.
devise_scope :user do
post 'users/sign_up' => 'users/registrations#create', as: 'user_registration'
get 'users/sign_up' => 'users/registrations#new', as: 'new_user_registration'
end

Replies: 1 comment

You must be logged in to vote
0 replies
Answer selected by brandomoreno06
# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
1 participant