Created
February 13, 2013 16:35
-
-
Save teaforthecat/4945889 to your computer and use it in GitHub Desktop.
This is an example of a field set using the nested_form gem along with the twitter bootstrap style framework. It enables very efficient editing of data and relationships since three objects can be edited at once. Instead of being directed to another form and having to go back, ajax is used to create a dynamic form.
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
%li.reference_group | |
.container-fluid | |
.row-fluid | |
.span1.move | |
%i.icon-move | |
.span4 | |
= f.input_field :label_markdown, placeholder: '<markdown enabled>' | |
= f.input :order, as: :hidden | |
.span7 | |
= f.link_to_remove class: 'btn btn-danger' do | |
%i.icon-minus-sign.icon-white | |
.row-fluid.references_container | |
.span12 | |
= f.link_to_add :references, class: 'btn' do | |
%i.icon-plus | |
Add Reference | |
%ul.sortable.references | |
= f.fields_for :references do |ff| | |
%li.reference | |
.row-fluid | |
.span1.move | |
%i.icon-move | |
.span11 | |
= render "admin/reference_fields", f: ff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment