brndn
November 27, 2006, 12:07pm
1
I’m trying to link to action using an image. This is what I’m working
with:
<%= button_to (‘Details’, :action => ‘details’, :id => product ) %>
Is there a good way to make the image the clickable item? Any
insights into button_to, and link_to that you want to share are
appreciated.
brndn
November 27, 2006, 12:57pm
2
On 27 November 2006 14:05, Brandon wrote:
I’m trying to link to action using an image. This is what I’m working
with:
<%= button_to (‘Details’, :action => ‘details’, :id => product ) %>
Is there a good way to make the image the clickable item? Any
insights into button_to, and link_to that you want to share are
appreciated.
<%= link_to image_tag(product.image_url), :action => ‘details’, :id =>
product %>
brndn
November 27, 2006, 9:50pm
3
Thanks a lot!
Is that basically a nested method?
brndn
November 27, 2006, 10:20pm
4
On 11/27/06, Brandon [email protected] wrote:
Thanks a lot!
Is that basically a nested method?
This is the same, but more readable. You pass the image as first
parameter
to the link_to method. The one posted before was simply omitting
parenthesis:
<%= link_to(image_tag(product.image_url), :action => ‘details’, :id =>
product) %>
brndn
November 28, 2006, 4:21am
5
which is better without parenthesis because it more legible, right?