Skip to content

Instantly share code, notes, and snippets.

@rorlab
Created October 4, 2014 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rorlab/911efc2e2e5791eb49ba to your computer and use it in GitHub Desktop.
Save rorlab/911efc2e2e5791eb49ba to your computer and use it in GitHub Desktop.
Simple_form scaffold erb template file for Bootstrap
<%%= simple_form_for(@<%= singular_table_name %>) do |f| %>
<%%= f.error_notification %>
<%- attributes.each do |attribute| -%>
<div class="form-group">
<%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>, input_html: { class: 'form-control' } %>
</div>
<%- end -%>
<div class="form-actions">
<%%= f.button :submit, class: 'btn btn-default' %>
</div>
<%% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment