0

I've searched for an answer to this and nothing has helped.

I have the following in my view:

<div id="user_nav">
<% if user_signed_in? %>
  Logged in as <strong><%= current_user.first_name  + " " +current_user.last_name%></strong>.
  <%= link_to 'Edit profile', edit_user_registration_path %> |
  <%= link_to "Logout", destroy_user_session_path, method: :delete %>
<% else %>
  <%= link_to "Sign up", new_user_registration_path %> |
  <%= link_to "Login", new_user_session_path %>
<% end %>

Which is straight from the railscast on devise. Suddenly the paths are not working anymore. (sign up or sign in) for example when I click login i get the error

No route matches {:controller=>"devise/home", :action=>"students"}

Ive tried using <%= link_to "Login", :controller => '/devise/sessions', :action => 'new' %> jsut for kicks and it returns the same error.

Yes I have devise_for :users in my route file.

rake routes return all the right routes including

new_user_session GET    /users/sign_in(.:format)                  devise/sessions#new
        user_session POST   /users/sign_in(.:format)                  devise/sessions#create

Any help would be awesome! I'm stumped!

4

1 回答 1

1

查看我的堆栈跟踪,我的布局中的某些东西(链接)正在抛弃它。我为设计创建了一个自定义布局,现在一切正常。

于 2013-01-03T00:11:08.480 回答