Created
October 24, 2012 09:07
-
-
Save linjunpop/3944995 to your computer and use it in GitHub Desktop.
Nested form and twitter bootstrap css.
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
| - if f.object.file? | |
| = f.input :file, label: false, wrapper: :append do | |
| = f.input_field :file, as: :string, readonly: true | |
| span | |
| = link_to 'Download', f.object.file_url, class: 'btn' | |
| = f.link_to_remove 'Remove document', class: 'btn btn-danger' | |
| - else | |
| = f.input :file, label: false, wrapper: :append do | |
| = f.input_field :file, as: :file | |
| span | |
| = f.link_to_remove 'Remove document', class: 'btn btn-danger' |
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
| = simple_nested_form_for(@vehicle, html: {class: 'form-inline'}) do |f| | |
| = f.fields_for :documents | |
| = f.link_to_add "Add a document", :documents |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment