1
我有这个在我看来:表单提交到不同的控制器 - 路由
<%= form_for @comment, :as => :post, :url => user_ticket_message_comments_path, :html => { :class => "add-comment", :id => "add-comment-" + @ticket.id.to_s } do |f| %>
<%= f.label :body, "Add comment" %>
<%= f.text_area :body %>
<%= f.submit "Add comment" %>
<% end %>
在我的routes.rb:
resources :users do
resources :tickets do
resources :messages do
resources :comments
end
end
end
我得到一个路由错误:
No route matches {:controller=>"comments"}
伟大的规则提醒! – TheIrishGuy
我该如何反映这种路由?我觉得它很直观(用户有门票有消息和评论) –
@rabid_zombie看到更改的答案 – psyho