the link_to command is really nice, especially with confirm built in - wondering if there is a way to use it with SVG images since SVG doesn''t seem to work with image_tag I can display svg images (in Firefox) with the following code: <embed width=32 height=32 src="/images/quit.svg" type="image/svg+xml"></embed> "normal" link_to code: <%= link_to(image_tag("quit.png"),:controller=>"project", :action=>"quit", :confirm=>"Existing Project Changes Might Get Lost - Are You Sure?") %> I can use straight html code with href calling .../project/quit but then miss the nice confirm method -- Posted via http://www.ruby-forum.com/.
jack <ngalaxy34@...> writes:> > the link_to command is really nice, especially with confirm built in - > wondering if there is a way to use it with SVG images since SVG doesn''t > seem to work with image_tag > > I can display svg images (in Firefox) with the following code: > > <embed width=32 height=32 src="/images/quit.svg" > type="image/svg+xml"></embed>Try this: <%=link_to "<embed width=''32'' height=''32'' src=''<%=url_for ''quit.svg''%>''></embed>", :controller => ''project'', :action => ''quit'', :confirm => "Existing Project Changes Might Get Lost -- Are You Sure?"%> I haven''t test this, but it should work. With that many nested quotes you might be better off escaping some of them. -- Pazu
thks for suggestion, I couldn''t use the url_for , it gave me an interminate string error but replacing it with the call to the /image directory, the svg image shows up but no hyperlink: <%= link_to "<embed width=32 height=32 src=''/images/quit.svg''> </embed>", :controller=>''program'', :action=>''quit'', :confirm=>''Existing Project Changes Might Get Lost Are You Sure?'' %> even if I wrap the link_to with parentheses like a regular link_to, it still doesn''t give the hyperlink hmmm, I don''t understand, any ideas? jack Pazu wrote:> jack <ngalaxy34@...> writes: > >> >> the link_to command is really nice, especially with confirm built in - >> wondering if there is a way to use it with SVG images since SVG doesn''t >> seem to work with image_tag >> >> I can display svg images (in Firefox) with the following code: >> >> <embed width=32 height=32 src="/images/quit.svg" >> type="image/svg+xml"></embed> > > Try this: > > <%=link_to "<embed width=''32'' height=''32'' src=''<%=url_for > ''quit.svg''%>''></embed>", :controller => ''project'', :action => ''quit'', > :confirm > => "Existing Project Changes Might Get Lost -- Are You Sure?"%> > > I haven''t test this, but it should work. With that many nested quotes > you might > be better off escaping some of them. > > -- Pazu-- Posted via http://www.ruby-forum.com/.