Created
August 31, 2009 16:03
-
-
Save beaucollins/178532 to your computer and use it in GitHub Desktop.
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
<%- form_for @album do |album_form| -%> | |
<!-- Album Form Stuff --> | |
<%- | |
# file_fields_for is where the magic happens. You supply the association to the model | |
# that has the 'attachment' as well as the property on that model that will receive | |
# the file upload data. This will take care of displaying the necessary upload fields | |
# | |
-%> | |
<%= album_form.attachment_fields_for :photos, :data %> | |
<%- | |
# If you need to display more than just a file field you can provide a block to the | |
# file_fields_for helper method, the file_fields_for method will take care of the dirty | |
# work and then you can supply and extra helper methods in the block | |
-%> | |
<%- album_form.attachment_fields_for :photos, :data do |photo_fields| -%> | |
<%= photo_fields.attachment_field %> | |
<%= photo_fields.checkbox :front %> | |
<%- end -%> | |
<%- end -%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment