Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

resolves #442 by not merging the button_html class into the wrapper_h…

…tml class
  • Loading branch information...
commit 80c11aebeedc0cd3ec1f542da74186b0e59b1979 1 parent b8f1390
@justinfrench authored
Showing with 5 additions and 3 deletions.
  1. +1 −1  lib/formtastic.rb
  2. +4 −2 spec/commit_button_spec.rb
View
2  lib/formtastic.rb
@@ -376,7 +376,7 @@ def commit_button(*args)
wrapper_html_class = ['commit', options.delete(:class)].compact # TODO: Add class reflecting on form action.
wrapper_html = options.delete(:wrapper_html) || {}
- wrapper_html[:class] = (wrapper_html_class << wrapper_html[:class] << button_html[:class]).flatten.compact.join(' ')
+ wrapper_html[:class] = (wrapper_html_class << wrapper_html[:class]).flatten.compact.join(' ')
accesskey = (options.delete(:accesskey) || self.class.default_commit_button_accesskey) unless button_html.has_key?(:accesskey)
button_html = button_html.merge(:accesskey => accesskey) if accesskey
View
6 spec/commit_button_spec.rb
@@ -468,12 +468,14 @@ def self.human_name
it 'should merge in classes applied using the :class option' do
with_deprecation_silenced do
form = semantic_form_for(@new_post) do |builder|
- concat(builder.commit_button('text', :class => 'from_button_html', :wrapper_html => {:class => 'from_wrapper_html'}))
+ concat(builder.commit_button('text', :class => 'from_class_option', :wrapper_html => {:class => 'from_wrapper_html'}, :button_html => { :class => 'from_button_html'}))
end
output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should have_tag("form li.commit")
- output_buffer.should have_tag("form li.from_button_html")
output_buffer.should have_tag("form li.from_wrapper_html")
+ output_buffer.should have_tag("form li.from_class_option")
+ output_buffer.should have_tag("form li input.from_button_html")
+ output_buffer.should_not have_tag("form li.from_button_html")
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.