Devise Custom Routes and Login Pages

后端 未结 6 1346
北荒
北荒 2020-11-30 23:12

I\'m trying to get Custom Routes working in my Rails application (Ruby 1.9.2 with Rails 3).

This is my config/routes.rb file

match \'/dashboard\' =&g         


        
6条回答
  •  感动是毒
    2020-11-30 23:28

    You just need don't put your special route in devise_for block

    match '/dashboard' => 'home#dashboard', :as => 'user_root'
    get "/login", :to => "devise/sessions#new" # Add a custom sign in route for user sign in
    get "/logout", :to => "devise/sessions#destroy" # Add a custom sing out route for user sign out
    get "/register", :to => "devise/registrations#new" # Add a Custom Route for Registrations
    devise_for :user
    

    Now /login works. /users/sign_in too.

提交回复
热议问题