Rails 3没有路由匹配{:action =>“show”,错误

时间:2014-02-19 12:13:26

标签: ruby-on-rails-3

虽然对这个错误有类似的问题,但大多数都与Rails路由处理多元化有关,而这是不同的。

我在名为MemberPage的控制器中的'show'视图页面上有一个链接,我需要链接到名为Post的控制器中的'new'操作

<%= link_to ((content_tag :i, "", :class => "icon-pencil") + content_tag(:span, 'create')), new_members_community_post_path %>

我有路线

resources :post

在佣金路线中产生以下相关行

new_members_community_post GET        /members/community/post/new(.:format)                                  members/community/post#new

将鼠标悬停在链接上显示

127.0.0.1:3000/members/community/post/new

点击它会产生错误

No route matches {:action=>"show", :controller=>"members/community/member_page"}

Rails匹配错误的控制器和rake路径中显示的错误操作

我尝试在routes.rb中创建显式匹配规则,例如(在成员/社区名称空间内)

match '/new-post' => 'post#new'

并用

替换link_to路径
:controller => :post, :action => :new

但无法找到有效的内容

0 个答案:

没有答案