Skip to content

Conversation

@ttanimichi
Copy link
Contributor

Hi,

Primary button classes aren't overridden when you pass classes as the option.

= post.primary 'create', class: 'btn btn-primary disabled' # disabled class is ignored!!

That's becase Hash#merge use other_hash's value.

options = { class: 'btn btn-primary disabled ' }
options.merge! class: 'btn btn-primary' #=> {:class=>"btn btn-primary"}

ActiveSupport's reverse_merge takes care of this problem.

options = { class: 'btn btn-primary disabled ' }
options.reverse_merge! class: 'btn btn-primary' #=> {:class=>"btn btn-primary disabled"}

Thanks.

@ttanimichi ttanimichi changed the title [WIP] Can't override primary button classes Can't override primary button's classes Dec 14, 2014
@potenza potenza merged commit ba689f3 into bootstrap-ruby:master Feb 18, 2015
@potenza
Copy link
Member

potenza commented Feb 18, 2015

@ttanimichi Sorry for the delay! Thanks!

@ttanimichi ttanimichi deleted the cannot_override_primary_button_classes branch February 28, 2015 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants