comfy / active_link_to

Rails view helper to manage "active" state of a link
MIT License
844 stars 84 forks source link

active_link_to yields to blocks #53

Closed sunnyrjuneja closed 7 years ago

sunnyrjuneja commented 7 years ago

Hello again Comfy,

Thank you for your great gem. It's been very handy. I was wondering if you would accept a pull request for active_link_to to yield to blocks if it's an active link. Here is my use case.

<%= active_link_to 'Some Path', some_path(@path) do %>
  <nav>Sub Navigation For Active Tab</nav>
<% end %

If not, no worries. I understand this might bloat your gem.

GBH commented 7 years ago

It already should be doing that. You have an extra argument in your code snippet though:

<%= active_link_to some_path(@path) do %>
  <nav>Sub Navigation For Active Tab</nav>
<% end %>
sunnyrjuneja commented 7 years ago

Wow, you thought of everything. Thanks!

danwetherald commented 2 months ago

This is not true, html passed to the do block will always render.