Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update with latest simple form fixes

  • Loading branch information...
commit aba30c94a0a5aa5d70e166b0459e832968ef5828 1 parent 75b82b6
@carlosantoniodasilva carlosantoniodasilva authored
View
4 Gemfile.lock
@@ -1,6 +1,6 @@
GIT
remote: git://github.com/plataformatec/simple_form.git
- revision: 099efb4d55d8d993961ff5c2446bb9715ae5df29
+ revision: 7bcd22411dac775352f5fba4e13321b306d2d3e8
specs:
simple_form (2.0.0.dev)
actionpack (~> 3.0)
@@ -98,7 +98,7 @@ GEM
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.31)
- uglifier (1.2.2)
+ uglifier (1.2.3)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
View
18 app/views/articles/_form.html.erb
@@ -41,33 +41,33 @@ simple_form_for(@article, :html => { :class => 'form-horizontal' }) do |f|
end
</pre>
- <%= f.input :published, :as => :boolean %>
+ <%= f.input :published, :as => :boolean %>
<pre class='prettyprint linenums lang-rb'>
f.input :published, :as =&gt; :boolean
</pre>
- <%= f.input :content_type, :collection => content_type_options, :as => :check_boxes, :label_html => { :class => 'checkbox' }, :label => 'Stacked checkboxes' %>
+ <%= f.input :content_type, :collection => content_type_options, :as => :check_boxes, :label => 'Stacked checkboxes' %>
<pre class='prettyprint linenums lang-rb'>
- f.input :content_type, :collection =&gt; content_type_options, :as =&gt; :check_boxes, :label_html =&gt; { :class =&gt; &#x27;checkbox&#x27; }
+ f.input :content_type, :collection =&gt; content_type_options, :as =&gt; :check_boxes
</pre>
- <%= f.input :content_type, :collection => content_type_options, :as => :check_boxes, :label_html => { :class => 'checkbox inline' }, :label => 'Inline checkboxes' %>
+ <%= f.input :content_type, :collection => content_type_options, :as => :check_boxes, :item_wrapper_class => 'inline', :label => 'Inline checkboxes' %>
<pre class='prettyprint linenums lang-rb'>
- f.input :content_type, :collection =&gt; content_type_options, :as =&gt; :radio, :label_html =&gt; { :class =&gt; &#x27;checkbox inline&#x27; }
+ f.input :content_type, :collection =&gt; content_type_options, :as =&gt; :radio_buttons, :item_wrapper_class =&gt; &#x27inline&#x27;
</pre>
- <%= f.input :content_type, :collection => content_type_options, :as => :radio, :label_html => { :class => 'radio' }, :label => 'Stacked radios' %>
+ <%= f.input :content_type, :collection => content_type_options, :as => :radio_buttons, :label => 'Stacked radios' %>
<pre class='prettyprint linenums lang-rb'>
- f.input :content_type, :collection =&gt; content_type_options, :as =&gt; :radio, :label_html =&gt; { :class =&gt; &#x27;radio&#x27; }
+ f.input :content_type, :collection =&gt; content_type_options, :as =&gt; :radio_buttons
</pre>
- <%= f.input :content_type, :collection => content_type_options, :as => :radio, :label_html => { :class => 'radio inline' }, :label => 'Inline radios' %>
+ <%= f.input :content_type, :collection => content_type_options, :as => :radio_buttons, :item_wrapper_class => 'inline', :label => 'Inline radios' %>
<pre class='prettyprint linenums lang-rb'>
- f.input :content_type, :collection =&gt; content_type_options, :as =&gt; :radio, :label_html =&gt; { :class =&gt; &#x27;radio inline&#x27; }
+ f.input :content_type, :collection =&gt; content_type_options, :as =&gt; :radio_buttons, :item_wrapper_class =&gt; &#x27;inline&#x27;
</pre>
<%= f.input :content_type, :collection => content_type_options,
View
8 config/initializers/simple_form.rb
@@ -85,6 +85,7 @@
# buttons and other elements.
config.default_wrapper = :bootstrap
+
# Define the way to render check boxes / radio buttons with labels.
# Defaults to :nested for bootstrap config.
# :inline => input + label
@@ -118,9 +119,14 @@
# You can define the class to use on all collection wrappers. Defaulting to none.
# config.collection_wrapper_class = nil
- # You can wrap each item in a collection of radio/check boxes with a tag, defaulting to span.
+ # You can wrap each item in a collection of radio/check boxes with a tag,
+ # defaulting to :span. Please note that when using :boolean_style = :nested,
+ # SimpleForm will force this option to be a label.
# config.item_wrapper_tag = :span
+ # You can define a class to use in all item wrappers. Defaulting to none.
+ # config.item_wrapper_class = nil
+
# How the label text should be generated altogether with the required text.
# config.label_text = lambda { |label, required| "#{required} #{label}" }
Please sign in to comment.
Something went wrong with that request. Please try again.