Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change default generator classes to .form-inputs and .form-actions

Makes it easier to integrate with bootstrap. Related to #424
  • Loading branch information...
commit 612c0067cf0313cd02c33c4870413a15e96a261a 1 parent 04f70e8
@carlosantoniodasilva carlosantoniodasilva authored
View
2  CHANGELOG.md
@@ -30,6 +30,8 @@
and is backported inside SimpleForm builder extensions.
More info in [#215](https://github.com/plataformatec/simple_form/issues/215)
* Add `item_wrapper_class` configuration option for collection radio buttons / check boxes inputs.
+ * Change default generator templates to use .form-inputs and .form-actions classes in wrapper divs.
+ (the latter is the default in bootstrap, so this makes it easier to integrate).
### deprecation
* Deprecate part of the old configuration API in favor of the wrapper API which allows you to customize your inputs
View
4 lib/generators/simple_form/templates/_form.html.erb
@@ -1,13 +1,13 @@
<%%= simple_form_for(@<%= singular_table_name %>) do |f| %>
<%%= f.error_notification %>
- <div class="inputs">
+ <div class="form-inputs">
<%- attributes.each do |attribute| -%>
<%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
<%- end -%>
</div>
- <div class="actions">
+ <div class="form-actions">
<%%= f.button :submit %>
</div>
<%% end %>
View
4 lib/generators/simple_form/templates/_form.html.haml
@@ -1,10 +1,10 @@
= simple_form_for(@<%= singular_table_name %>) do |f|
= f.error_notification
- .inputs
+ .form-inputs
<%- attributes.each do |attribute| -%>
= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>
<%- end -%>
- .actions
+ .form-actions
= f.button :submit
View
4 lib/generators/simple_form/templates/_form.html.slim
@@ -1,10 +1,10 @@
= simple_form_for(@<%= singular_table_name %>) do |f|
= f.error_notification
- .inputs
+ .form-inputs
<%- attributes.each do |attribute| -%>
= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>
<%- end -%>
- .actions
+ .form-actions
= f.button :submit
Please sign in to comment.
Something went wrong with that request. Please try again.