scottc
2012-Dec-12 00:12 UTC
Adding a hyperlink to a pop-up window on a form field label in Rails
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?" %> I appreciate any ideas. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/9t5akXsW_u4J. For more options, visit https://groups.google.com/groups/opt_out.
Walter Lee Davis
2012-Dec-12 02:47 UTC
Re: Adding a hyperlink to a pop-up window on a form field label in Rails
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) %> 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Jim Ruther Nill
2012-Dec-12 02:52 UTC
Re: Adding a hyperlink to a pop-up window on a form field label in Rails
On Wed, Dec 12, 2012 at 10:47 AM, Walter Lee Davis <waltd-HQgmohHLjDZWk0Htik3J/w@public.gmane.org>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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.