Forum: Ruby on Rails Embedding links in text fields

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
vin (Guest)
on 2007-03-11 03:12
I am trying to buld a link with text displayed within a text_field or
text_field_tag. e.g. the following text field displays an ID of 1.

    <%= text_field_tag(@contact, , {:readonly => true}) %>

I would like the 1 to also be a hyper link to allow me open and show

Effectively I am trying to do something like

    <%= text_field_tag(@contact, <%= link_to, :action =>
'show_contact', :id => %> , {:readonly => true}) %>
Xavier N. (Guest)
on 2007-03-11 11:37
(Received via mailing list)
On Mar 11, 2007, at 2:12 AM, vin wrote:

>     <%= text_field_tag(@contact, <%= link_to, :action =>
> 'show_contact', :id => %> , {:readonly => true}) %>

I don't think you can do that. Browsers "strip" most markup from text
field contents.

-- fxn
This topic is locked and can not be replied to.