Last active
August 29, 2015 14:22
-
-
Save palkan/731e27c44d730e13ce32 to your computer and use it in GitHub Desktop.
NestedForm + CarrierWave
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= nested_form_for answer, remote: true, ... do |f| | |
... | |
= f.fields_for :attachments do |attachment_form| | |
- if attachment_form.object.file.present? | |
p = attachment_form.object.file.identifier | |
- else | |
= attachment_form.label :file | |
= attachment_form.file_field :file | |
= attachment_form.link_to_remove "Remove this file" | |
= f.link_to_add "Add file", :attachments | |
= f.submit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment