Reputation: 65
I'm getting
$ syntax error, unexpected keyword_class, expecting keyword_do or '{' or '('
in this line
$ %li = link_to 'Features', features_path class => ('active' if params[:action] == 'features')%li
Upvotes: 0
Views: 1402
Reputation: 34613
%li = link_to 'Features', features_path, :class => ('active' if params[:action] == 'features')
%li
. Edit:
To add the class to the %li
tag, try this:
%li{:class => (params[:action] == 'features' ? 'active' : nil)}
= link_to 'Features', features_path
Upvotes: 2