我想知道什么是在导轨中为不同页面设置导航链接的好方法?现在我已经休息了。下面是代码在导轨中设置导航栏/链接的好方法
_nav.html.erb
<ul class="nav nav-pills pull-right">
<%if current_page?(:action => 'new') %>
<li><%= link_to "Home", root_path%></li>
<%elsif current_page?(:controller => 'home', :action => 'index') %>
<li><%= link_to "Contact", home_contact_path%></li>
<%end%>
</ul>
所以,当我做一个<%= render :partial => 'layouts/nav' %>
下/views/home/index.html.erb
它给了我一个错误
No route matches {:action=>"new", :controller=>"home"}
请提供'耙的输出routes' – gabrielhilal 2013-03-02 09:49:49
这里的路线-http://pastebin.com/qpdAYDKw – psharma 2013-03-02 12:22:22