Reputation: 155
How to DRY this code with helper?
<% if current_user %>
<%= link_to "All images", images_path %>
<% end %>
Thanks
Upvotes: 3
Views: 76
Reputation: 27789
You can use the link_to_if
helper:
<%= link_to_if current_user, 'All Images', images_path %>
Upvotes: 4