Skip to content
This repository has been archived by the owner on Aug 4, 2018. It is now read-only.

Commit

Permalink
Merge pull request #43 from antonlitvinenko/patch-1
Browse files Browse the repository at this point in the history
setting @options to opts overwrites options of form builder
  • Loading branch information
sethvargo committed May 17, 2012
2 parents 57048f7 + 3fe80e2 commit 56c70dc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/bootstrap_forms/form_builder.rb
Expand Up @@ -53,16 +53,15 @@ def check_box(name, *args)


def radio_buttons(name, values = {}, opts = {}) def radio_buttons(name, values = {}, opts = {})
@name = name @name = name
@options = opts
@field_options = opts @field_options = opts
control_group_div do control_group_div do
label_field + input_div do label_field + input_div do
values.map do |text, value| values.map do |text, value|
if @field_options[:label] == '' || @field_options[:label] == false if @field_options[:label] == '' || @field_options[:label] == false
extras { radio_button(name, value, @options) + text } extras { radio_button(name, value, @field_options) + text }
else else
label("#{@name}_#{value}", :class => [ 'radio', required_class ].compact.join(' ')) do label("#{@name}_#{value}", :class => [ 'radio', required_class ].compact.join(' ')) do
extras { radio_button(name, value, @options) + text } extras { radio_button(name, value, @field_options) + text }
end end
end end
end.join.html_safe end.join.html_safe
Expand Down

0 comments on commit 56c70dc

Please sign in to comment.