I think that you're looking for something like that....
<%= link_to_unless_current('Add contact', new_contact_url, :class =>
'adduser') { link_to('Add contact', new_contact_url, :class =>
'selected') } %>
http://apidock.com/rails/ActionView/Helpers/UrlHelper/link_to_unless_current
Adam Akhtar escribió:
> MaD wrote:
>
>> i don't see your code, but generally it works like this:
>> <%= link_to "Link name", { :controller => 'controller_name', :action
>> => 'action_name' }, :class => 'someclass' %>
>>
>> then you style your "someclass" via css.
>>
>
> Thanks for the reply, but doesnt the above add the class "someclass" to
> all four links at the same time? I dont want to do taht, i want to add
> something like "selected" to the currently active link and "unselected"
> to the other three? If that is so how would you style the currently
> selected link differently that the other three?
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---