Created
November 3, 2011 03:42
-
-
Save ivanvanderbyl/1335718 to your computer and use it in GitHub Desktop.
BootstrampFormBuilder
This file contains hidden or 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 Formtastic | |
class BootstrapFormbuilder < SemanticFormBuilder | |
def basic_input_helper(form_helper_method, type, method, options) #:nodoc: | |
html_options = options.delete(:input_html) || {} | |
html_options = default_string_options(method, type).merge(html_options) if [:numeric, :string, :password, :text, :phone, :search, :url, :email].include?(type) | |
field_id = generate_html_id(method, "") | |
html_options[:id] ||= field_id | |
label_options = options_for_label(options) | |
label_options[:for] ||= html_options[:id] | |
label(method, label_options) << | |
template.content_tag(:div, :class => 'input') do | |
send(respond_to?(form_helper_method) ? form_helper_method : :text_field, method, html_options) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment