To make a image as a link, you have to use the following syntax,
<%= link_to(image_tag(“delete.png” , :size => “50×22″ ),
{ :controller => “admin” ,
:action=> “delete” ,
:id => @product},
{ :confirm=> “Are you sure?” })
%>
19 Apr
To make a image as a link, you have to use the following syntax,
<%= link_to(image_tag(“delete.png” , :size => “50×22″ ),
{ :controller => “admin” ,
:action=> “delete” ,
:id => @product},
{ :confirm=> “Are you sure?” })
%>
Posted by Ray Parker on September 8, 2010 at 5:04 pm
With the above code I get a GET on the item and I’m taken to the show view, and no confirmation still. Any updates on delete confirmation with a link_to/image_tag? I’ve been wresting with this one on and off for a few weeks (Rails3 rc.* and Rails 3.0.0)
Posted by Ben on March 19, 2011 at 2:35 am
@ray
image_submit_tag ?