A nice set of view helper in Rails
These helpers allow you to conditionally render a link. They also provide a nice way of showing different links based on the conditional.
For example you can show a “Logout” link if the user has signed in or the “Login” link (inside of the block) if they have not yet signed in.
<%= link_to_if user_signed_in?, "Logout", destroy_user_session_path, method: :delete do %> <%= link_to "Login", new_user_session_path %> <% end %>