I am trying to set up my routes in development. I tried using devise_scope: user, but it does not work. So I switched to devise_for and skipped the user routes (registrations, confirmations, passwords, session), and it worked. But then an error appears in my views when I called, for example, "session_path". He made the form redirect to "session.user", which makes no sense.
Here is the code:
# routes.rb
devise_for: users,: path => '',: skip => [: passwords,: registrations,: confirmations] do
post "account / password",: to => "devise / passwords # create"
get "account / password / new",: to => "devise / passwords # new",: as => "new_password"
get "account / password / edit",: to => "devise / passwords # edit",: as => "edit_password"
put "account / password",: to => "devise / passwords # update"
post "account",: to => "users / registrations # create"
get "sign_up",: to => "users / registrations # new"
delete "account",: to => "users / registrations # destroy"
post "confirmation",: to => "devise / confirmations # create"
get "confirmation / new",: to => "devise / confirmations # new",: as => "new_confirmation"
get "confirmation",: to => "devise / confirmations # show"
end
New session view:
# users / sessions / new.html.erb
= form_for (resource,: as => resource_name,: url => session_path (resource_name)) do | f | %>
Error:
No route matches {: action => "new",: format =>: user,: controller => "devise / passwords"}
What should I do? What happened to "devise_scope" does not work correctly (the error it was showing was "Could not find graphic display for ...")?
thanks