Reputation: 2364
I'm trying to get this class to also use this custom method I have to check if the link is currently clicked on
=link_to 'Contact' , contact_path, :class => 'col-lg-4 col-md-4 col-sm-5 col-xs-4 ', :class => is_active?('contact)', :id => "contact"
Setting class 2 times has not worked anyone know how I can do this?
Upvotes: 0
Views: 59
Reputation: 339
I thinks that xdazz is right that you can't set class twice. But you could add
is_active?('contact)'
to the classes :
:class => 'col-lg-4 col-md-4 col-sm-5 col-xs-4 #{is_active?(contact)}'
(assuming that is_active?(contact) results in a boolean value)
Upvotes: 1
Reputation: 160863
You can't set class
twice.
:class => is_active? ? 'col-lg-4 col-md-4 col-sm-5 col-xs-4' : 'col-lg-4 col-md-4 col-sm-5 col-xs-4 contact'
Upvotes: 1