我正在尝试添加一条路线,使我能够将两个“文章”合并在一起,但无论我尝试什么,当路线实际上似乎匹配时,我都会不断收到“无路线匹配”。
在我看来:
<%= label_tag(:merge_with, "Article ID:") %>
<%= text_field_tag(:merge_with) %>
<%= button_to "Merge", {:controller=>'admin/articles', :action=>'merge_article'}, :method => :post %>
从我的路线.rb:
match 'articles/:id/merge' => 'articles#merge_article', :via => :post, :as => 'merge_article'
rake 路由的输出:
merge_article POST /articles/:id/merge(.:format) {:controller => "articles", :action => "merge_article"}
页面留言:
没有路线匹配 {:controller => "admin/articles", :action => "merge_article"}