I’m trying to adjust the standard application template in Rails to insert a class around the notice and alert messages, but I can’t seem to find an elegant way of doing it.
At present, I have the scaffold:
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
I want it to only show the surrounding tags if a notice or alert is present.
Use an
ifstatement.