Skip to content
This repository has been archived by the owner on Oct 12, 2019. It is now read-only.

Commit

Permalink
Merge pull request #98 from jtomaszewski/patch/inline-radio-checkbox-…
Browse files Browse the repository at this point in the history
…input

Add :inline option to Radio and CheckBoxesInput.
  • Loading branch information
sodabrew committed Feb 13, 2014
2 parents dde5823 + eae5fb7 commit cedeae9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/formtastic-bootstrap/inputs/check_boxes_input.rb
Expand Up @@ -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
Expand All @@ -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

Expand Down
5 changes: 3 additions & 2 deletions lib/formtastic-bootstrap/inputs/radio_input.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit cedeae9

Please sign in to comment.