So I have one form working just fine:
<%= form_for([@document, @comment]) do |f| %>
And then I have another form where I need to include a Carrierwave upload that is like this:
<%= form_for([@document, @comment]), :html => { :multipart => true } do |f| %>
The first one works fine but the second one breaks by pointing to the form definition with the erro开发者_如何学编程r:
undefined method `comments_path' for #<#<Class:0x0000010475dde8>:0x0000010475a440>
Any ideas? Running Rails 3.0.0 with Ruby 1.9.2p180
<%= form_for([@document, @comment], :html => { :multipart => true }) do |f| %>
<%= form_for (@comment, :url => [@document, @comment], :html => {:multipart => true}) do |f| %>
I believe that will fix it for you.
精彩评论