Hi,

Sometimes it is useful to use label with both a contained label and 
supplied content, eg, in Devise's default registration edit view this is 
the supplied code for passwords:

[...]
  <div><%= f.label :password %> <i>(leave blank if you don't want to change 
it)</i><br />
  <%= f.password_field :password, :autocomplete => "off" %></div>
[...]

It would be useful for formatting if this code could be:

[...]
  <div><%= f.label :password, :add_content => true do %> <i>(leave blank if 
you don't want to change it)</i><% end %><br />
  <%= f.password_field :password, :autocomplete => "off" %></div>
[...]

Generating the following html:

[...]
  <div><label for="user_password"> <i>(leave blank if you don't want to 
change it)</i></label><br />
[...]

Currently using a method (:password) is mutually exclusive with supplying a 
block.

So, in other words, if I submit a patch to do this, would it be accepted ?

Another alternative would be to have a label_content helper returning the 
calculated content.

Thanks,
Cheers,
Luis Reis

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/0XIGLU1oyH8J.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to