Created
July 15, 2013 17:51
-
-
Save fjfish/6001949 to your computer and use it in GitHub Desktop.
Put your list of form fields in, load the file in irb, and out pops the html ready to be edited without you having to do a lot of repetitive typing
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
def make_group col | |
<<-EOT | |
<div class="control-group"> | |
<%= form.label :#{col}, class: 'control-label' %> | |
<div class="controls"> | |
<%= form.text_field :#{col}, { class: 'input-xlarge' } %> | |
</div> | |
</div> | |
EOT | |
end | |
[ | |
:title, | |
:first_name, | |
:last_name, | |
:address1, | |
:address2, | |
:address3, | |
:town, | |
:postcode, | |
].each do |col| | |
puts make_group col | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment