这真的很奇怪。我在每个页面上都存在的 link_to 上遇到路由错误
这是我的路线
resources :users do
member do
get :creations_tab, :path => '/creations'
end
这转化为
creations_tab_user_path GET /users/:id/creations(.:format) users#creations_tab
这是错误发生的地方
<li><%= link_to content_tag(:i," ", :class=>"icon-bullhorn")+ " " +"Creations", creations_tab_user_path %></li>
奇怪的部分是这个link_to是每个页面上都存在的导航栏中的链接..有些页面可以工作,有些页面不能......
这是错误
ActionController::RoutingError - No route matches {:action=>"creations_tab", :controller=>"users"}:
(gem) actionpack-3.2.12/lib/action_controller/metal/exceptions.rb:11:in `initialize'
(gem) actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:533:in `raise_routing_error'
(gem) actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:529:in `rescue in generate'
(gem) actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:521:in `generate'
(gem) actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:562:in `generate'
(gem) actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:587:in `url_for'
(gem) actionpack-3.2.12/lib/action_dispatch/routing/url_for.rb:148:in `url_for'
(gem) actionpack-3.2.12/lib/action_view/helpers/url_helper.rb:107:in `url_for'
(gem) actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:213:in `creations_tab_user_path'
app/views/layouts/_header.html.erb:43:in `_app_views_layouts__header_html_erb__541622111_70332144'