I have been trying to add a class to my link_to for over an hour now. No matter what I try, I get an error.
<% if user_signed_in? %>
<li>
<%= link_to('Sign out', destroy_user_session_path, :method => :delete) %>
</li>
<% else %>
<li>
<%= link_to('Sign in', new_user_session_path) %>
</li>
<% end %>
I am trying to add :class => "page-scroll btn-signin" to both of my link_to lines.
<%= link_to 'Sign out', destroy_user_session_path, :method => :delete, :class => "page-scroll btn-signin" %>
This code works correctly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With