Created
April 7, 2012 12:11
-
-
Save jalberto/2328270 to your computer and use it in GitHub Desktop.
dynamic form with cocoon
This file contains 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
= semantic_form_for(@event, :html => {:multipart => true, :id => "logoUpload", :'data-ajax' => false}) do |f| | |
= f.inputs do | |
= f.input(:logo, :as => :file) | |
= f.input(:logo_cache, :as => :hidden) | |
= f.input(:name) | |
= f.input(:info) | |
#matches | |
= f.inputs :for => [:matches] do |mf| | |
= render :partial => 'match_fields', :locals => {:f => mf} | |
.links | |
= link_to_add_association 'add match', f, :matches | |
= f.buttons |
This file contains 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-fields | |
= f.inputs do | |
= f.input(:score) | |
= f.input(:date, :as => :date) | |
= link_to_remove_association "remove match", f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment