SailsJs. Adding “active” class to navbar. How to? Not with client javascript

90 views
Skip to first unread message

Ucc

unread,
Oct 5, 2014, 7:34:54 PM10/5/14
to sai...@googlegroups.com

I am following the SailsCasts and I would like to figure out how to set .ejs template from the class "active" in my navbar according to the link that I'm browsing.

I do not want to use the "title" of the page as well as imagined is quite weak. Nor do I want to use JavaScript on the client side. I would like the class "active" in the navbar Bootstrap was written directly on the server side depending on the page I'm visiting.

A parameter to be passed through the routes?

Ambroise Dhenain

unread,
Oct 6, 2014, 1:56:42 AM10/6/14
to Ucc, sai...@googlegroups.com
You can access to "req.target.controller" and "req.target.action" in sails 10.x :)
--
Cordialement,

M. Ambroise Dhenain.
Reply all
Reply to author
Forward
0 new messages