L
L
lavezzi12015-08-09 08:40:09
css
lavezzi1, 2015-08-09 08:40:09

How is the active menu item selected in a dynamic application?

Hello. There is a standard menu. In static pages, it is clear how to implement this. And in the app? let's say on ror?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
vadimstroganov, 2015-08-09
@lavezzi1

Try the 'active_link_to' gem
And then use the active_link_to helper like so:
Clicking on this link will set the active class to it.

T
TyzhSysAdmin, 2015-08-09
@POS_troi

Yesterday asked the same question
How to set a class for certain pages?

C
CapeRatel, 2015-08-09
@CapeRatel

Sets the active link class.
Through js, iterate over the menu links and compare the current address with the href of each link in the menu. if it matches, substitute the class

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question