Permalink
Browse files

Add support for passing html options to #inputs

  • Loading branch information...
1 parent 5c3e7c6 commit b455222017acf362de23c5254315f5072a5b8fec Grant Hutchins & Ryan Ong committed Nov 4, 2011
Showing with 3 additions and 3 deletions.
  1. +1 −1 README.markdown
  2. +2 −2 lib/twitter_bootstrap_form_for/form_builder.rb
View
@@ -21,7 +21,7 @@ Just Rails. But you were going to use that anyway, weren't you?
= twitter_bootstrap_form_for @user do |user|
/ wraps a section in a fieldset with the provided legend text
- = user.inputs 'Sign up' do
+ = user.inputs 'Sign up', :html => {:class => "sign_up"} do
/ generates a standard email field
= user.email_field :email, :placeholder => 'me@example.com'
@@ -28,12 +28,12 @@ class TwitterBootstrapFormFor::FormBuilder < ActionView::Helpers::FormBuilder
# Wraps the contents of the block passed in a fieldset with optional
# +legend+ text.
#
- def inputs(legend = nil, &block)
+ def inputs(legend = nil, options = {}, &block)
# stash the old field_error_proc, then override it temporarily
original_field_error_proc = template.field_error_proc
template.field_error_proc = lambda {|html_tag, instance| html_tag }
- template.content_tag(:fieldset) do
+ template.content_tag(:fieldset, options[:html]) do
template.concat template.content_tag(:legend, legend) unless legend.nil?
block.call
end

0 comments on commit b455222

Please sign in to comment.