Forum: Ruby on Rails Embedding links in text fields

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0c96554da21936addce011427bd0554d?d=identicon&s=25 vin (Guest)
on 2007-03-11 02: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, @contact.id , {:readonly => true}) %>

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

Effectively I am trying to do something like

    <%= text_field_tag(@contact, <%= link_to @contact.id, :action =>
'show_contact', :id => @contact.id %> , {:readonly => true}) %>
7223c62b7310e164eb79c740188abbda?d=identicon&s=25 Xavier Noria (Guest)
on 2007-03-11 10:37
(Received via mailing list)
On Mar 11, 2007, at 2:12 AM, vin wrote:

>
>     <%= text_field_tag(@contact, <%= link_to @contact.id, :action =>
> 'show_contact', :id => @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.