我有以下路由:
resources :pages do
resources :logos do
member do
post 'vote'
end
end
end
然后我有一个在 /pages/:page_id/logos 中呈现的视图,如下所示:
<ul>
<% @logos.each do |logo| %>
<li>
<%= image_tag(logo.url) %>
<%= form_for([logo.page, logo], url: {action: "vote"}, :method => :post) do |f| %>
<% end %>
</li>
<% end %>
</ul>
我不断收到这个错误:
No route matches {:action=>"vote", :page_id=>"95", :controller=>"logos"}
我在这里想念什么?