Created
June 6, 2015 02:16
-
-
Save rebelweb/ce795b9f1f1f0fb4a3cd to your computer and use it in GitHub Desktop.
Nested Form
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 @playlist do |f| %> | |
<%= f.text_field :name, placeholder: 'Name' %> | |
<%= f.text_area :description %> | |
<%= f.date_field :date_in %> | |
<%= f.date_field :date_out %> | |
<%= f.fields_for :media_files do |ff| %> | |
<%= ff.collection_select :media_file_id, MediaFile.all, :id, :name, {}, {} %> | |
<%= ff.select :position, options_for_select((1..50).step(1) {} | |
<%= ff.link_to_remove 'Remove from Playlist' %> | |
<% end %> | |
<%= f.link_to_add 'Add Media File', :media_files %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment