11175
(-- --)
1
Hi all
I'm iterating over navigation page links using HAML. I want to assign
the current page's link the CSS class .current trying to use:
%li{:class => 'current' if params[:page] == i}
Sadly this doesn't work. How can I achieve the wanted result?
Thanks for help,
Josh
Steve_Ross
(Steve Ross)
2
params are always returned as strings. Use params[:page].to_i == i or params[:page] == i.to_s. See if that works.
Peter11
(Peter)
4
I use this line in HAML, and that works fine.
%li{:class => ("active" if item[:item] == active_menu_item)}
so maybe it's the ( ) that do the trick?
11175
(-- --)
5
Peter wrote:
I use this line in HAML, and that works fine.
%li{:class => ("active" if item[:item] == active_menu_item)}
so maybe it's the ( ) that do the trick?
On Feb 18, 10:56 am, Joshua Muheim <rails-mailing-l...@andreas-s.net>
Yes, this seemed to be the problem. Thanks.