Reputation: 11971
I'm new to Rails, so forgive me if it's something simple, but it does seem as if though what I've written is correct. I'm using a ternary operator in my view to decide whether to add a class of active or not:
<li class="<% is_current_page('') ? 'active' : '' %>">
And I've debugged and know for sure that is_current_page('')
is returning true
.
Upvotes: 8
Views: 12925
Reputation: 755
this is what you need to do : <li class="<%= is_current_page('') ? 'active' : '' %>">
Upvotes: 0
Reputation: 7311
You probably wanted to do
<li class="<%= is_current_page('') ? 'active' : '' %>">
Upvotes: 2
Reputation: 5292
You missed =
<li class="<%= is_current_page('') ? 'active' : '' %>">
Upvotes: 19