On Wed, Dec 12, 2012 at 10:47 AM, Walter Lee Davis <[email protected]>wrote:

>
> On Dec 11, 2012, at 7:12 PM, scottc wrote:
>
> > Is there a way to embed a hyperlink in a form label in Rails using
> link_to?
> >
> > I am trying to do this in a form field as follows:
> >
> > <%= f.label "Accept Terms of Service?" %>
>
> Try this:
>
> <%= f.label("#{link_to('Accept Terms of Service',
> '/terms_of_service.html')}".html_safe) %>
>

Looking at the api, I think it's possible to pass a block for a nested
label tag

http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-label


>
> Walter
>
> --
> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
-------------------------------------------------------------
visit my blog at http://jimlabs.heroku.com

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to