Created
April 12, 2012 13:33
-
-
Save pacovell/2367235 to your computer and use it in GitHub Desktop.
simple_form bootstrap 2.0.x :span component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SimpleForm | |
module DoneComponents | |
module Span | |
def span | |
if options[:span] | |
input_html_classes << 'input-block-level' | |
options[:wrapper_html] ||= {} | |
options[:wrapper_html][:class] ||= "" | |
options[:wrapper_html][:class] <<= " #{options[:span]}" | |
end | |
# Return value is output directly, so return nil | |
nil | |
end | |
end | |
end | |
end | |
class SimpleForm::Inputs::Base | |
include SimpleForm::DoneComponents::Span | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just put this at the bottom of config/initializers/simple_form.rb and then replace
with
Works with fluid and fixed grids.