Ruby on Rails - Devise always redirect to the root_path -


in ruby on rails application use devise authenticate "admins".

i'm using "admin" model modified 'routes.rb' file define custom routes of site

routes.rb

rails.application.routes.draw   resources :contacts    devise_for :admins    #personal devise admin routes   :admin      #session block     "/login" => "devise/sessions#new",  :as => :admin_session_login     delete "/logout" => "devise/sessions#destroy", :as => :admin_logout      #account block     "/register" => "devise/registrations#new", :as => :admin_register     "/edit_account" => "devise/registrations#edit", :as => :admin_edit    end end 

i saved file , restarted server when try navigate 1 of custom routes '/login' application redirect me http://localhost:3000/

i post server console log when try navigate /login:

console server log

  started "/login" 127.0.0.1 @ 2015-06-29 18:15:32 +0200       activerecord::schemamigration load (0.4ms)  select "schema_migrations".* "schema_migrations"     processing devise::sessionscontroller#new html       admin load (0.3ms)  select  "admins".* "admins" "admins"."id" = ?  order "admins"."id" asc limit 1  [["id", 1]]     redirected http://localhost:3000/     filter chain halted :require_no_authentication rendered or redirected     completed 302 found in 46ms (activerecord: 0.9ms  ) 

i can not add comment. if have logined, redirected root_path. , can try path find out.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -