开发者

ActionView::MissingTemplate when trying out Devise Login Items

开发者 https://www.devze.com 2023-01-26 17:46 出处:网络
Now, I have to admit, I\'m totally new to Ruby on Rails and don\'t quite understand every concept. I have installed Devise for authentication and followed this guide to include sign up and log in link

Now, I have to admit, I'm totally new to Ruby on Rails and don't quite understand every concept. I have installed Devise for authentication and followed this guide to include sign up and log in links in my views.

Here's what I did in my application.html.erb:

<ul class="hmenu">
  <%= render 'devise/menu/registration_items' %>
  <%= render 'devise/menu/login_items' %>
</ul>

And my views/devise开发者_如何转开发/menu/_login_item.html.erb looks like this:

<% if user_signed_in? %>
  <li>
  <%= link_to('Logout', destroy_user_session_path) %>        
  </li>
<% else %>
  <li>
  <%= link_to('Login', new_user_session_path)  %>  
  </li>
<% end %>

Now I get the following error message:

ActionView::MissingTemplate in Home#index
Missing partial devise/menu/login_items with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths "/Users/blah/Documents/webapp/mapeval/app/views", "/Users/blah/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.3/app/views"

What is the cause of that error?


Your partial has invalid filename (missing s at the end). Rename views/devise/menu/_login_item.html.erb to views/devise/menu/_login_items.html.erb

0

精彩评论

暂无评论...
验证码 换一张
取 消