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
Post a Comment