Rails 4, Devise Routes -


i've created custom routes route devise login , logout paths:

devise_scope :admin   "logout" => "devise/sessions#destroy", as: :logout   "login" => "devise/sessions#new", as: :login end 

this works. problem if the login fails redirects admins/sign_in instead of /login.

any ideas?

according this answer , this description, seems proper way achieve you're attempting make use of :path_names option. according description devise wiki:

devise_for :admin, :path => '', :path_names => {:sign_in => 'login', :sign_out => 'logout'} 

will create normal admin routes you, , assign /sign_in , /sign_out route /login/ , /logout respectively.

using :path option, can further alter url, such using :path=>"admins" yield routes /admin/login, etc.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -