Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using link_to_unless_current for conditional links in breadcrumbs #652

Open
olbrich opened this issue Nov 8, 2023 · 0 comments

Comments

@olbrich
Copy link
Contributor

olbrich commented Nov 8, 2023

<% if url && url != request.url %>
<%= link_to label, url, class: "#{item_style} hover:text-slate-700 hover:underline dark:text-primary-300" %>
<% else %>
<span class="<%= item_style %>"><%= label %></span>
<% end %>

Could become...

    <%= link_to_unless_current(label, url, class: "#{item_style} hover:text-slate-700 hover:underline dark:text-primary-300") do %>
       <span class="<%= item_style %>"><%= label %></span> 
    <% end %> 

This is purely a style thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant