<%= f.label :terms, "<span>Accept #{link_to 'Terms', terms_path}</
span>" %>
versus
<% f.label :terms do %>
<span>Accept <%= link_to "Terms", terms_path %></span>
<% end %>
Ticket with patch/tests:
Stephen
label_tag nil, "Your Name" do
text_field_tag 'name'
end
IMO, the signature of #label_tag (and #label) should evolve to better
support this practice as it reduces the need to keep DOM ids in sync
between the input and the label. Perhaps by counting args to
label_tag and assuming a single string argument is a contextual label.
> https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/3...
>
> Stephen
Stephen
> >https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/3645-let-label-helpers-accept-blocks
>
> > Stephen