Open vmcilwain opened 10 years ago
Just a passer-by... but it looks like you forgot to add :document
to your discussion_attachments_attributes array?
Err, why do you have both form_for
and nested_form_for
? Use one of them, but not both.
nested_form_for
is gonna use the helpers provided by this gem (So you can use fields_for
, link_to_add
, etc..)
form_for
is gonna use Rails default helpers.
<%= nested_form_for @discussion, url: admin_discussions_path, method: :post do |f| do |f| %>
Hello,
I am trying to get the nested_form gem to work in rails 4.1 for adding attachments using paperclip. Everything renders as expected but when I submit the form nothing happens. No errors, no log output or anything.
I am not sure the best way to debug this problem since I basically don't have anything to go on. Has anyone else has run into this problem or can you give advice for the best way I can attack this?
What I currently have is as follows:
discussions_controller.rb:
discussion.rb
discussion_attachment.rb
new.html.erb
UPDATE: The form works as it is supposed to when I uncomment the nested_form_for block. But the moment I uncomment that block but leave the fields_for block on the inside of that commented out this issue shows. This same issue happens in rails 4.0.4.