Use Rails link_to_unless_current for navigation links

We’re all familiar with the classic Rails link_to helper. But did you know there is a link_to_unless_current variant?It works just link link_to except that it doesn’t create a link if the browsers current URL is the same as the link target.
Use Rails link_to_unless_current for navigation links #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/use-rails-link_to_unless_current-for-navigation-links

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles