I am currently facing a challenge in my view where I need to dynamically add an "active" class based on the page the user is viewing. Here's the code snippet:
<li <%= if current_page?(root_path) then "class='hvr-bottom active'" else "class='hvr-bottom'" end %>><a href=<%= root_path %>>Home</a></li>
However, when I try to execute this code, it triggers an error message:
syntax error, unexpected keyword_class, expecting keyword_then or ';' or '\n' ...
I'm looking for guidance on how to appropriately modify the code so that the additional class is only added when a specific page is being viewed.