Permalink
Browse files

Merge pull request #98 from jtomaszewski/patch/inline-radio-checkbox-…

…input

Add :inline option to Radio and CheckBoxesInput.
  • Loading branch information...
2 parents dde5823 + eae5fb7 commit cedeae9a67a414ac17851e2642b175fafa86ccc4 @sodabrew sodabrew committed Feb 13, 2014
@@ -5,7 +5,6 @@ class CheckBoxesInput < Formtastic::Inputs::CheckBoxesInput
include Base::Choices
# TODO Make sure help blocks work correctly.
- # TODO Support .inline
def to_html
form_group_wrapping do
@@ -30,9 +29,11 @@ def choice_html(choice)
end
def checkbox_wrapping(&block)
+ class_name = "checkbox"
+ class_name += " checkbox-inline" if options[:inline]
template.content_tag(:div,
template.capture(&block).html_safe,
- :class => "checkbox"
+ :class => class_name
)
end
@@ -5,7 +5,6 @@ class RadioInput < Formtastic::Inputs::RadioInput
include Base::Choices
# TODO Make sure help blocks work correctly.
- # TODO Support .inline
def to_html
form_group_wrapping do
@@ -35,9 +34,11 @@ def choice_html(choice)
end
def radio_wrapping(&block)
+ class_name = "radio"
+ class_name += " radio-inline" if options[:inline]
template.content_tag(:div,
template.capture(&block).html_safe,
- :class => "radio"
+ :class => class_name
)
end

0 comments on commit cedeae9

Please sign in to comment.