Michael Delaney wrote:
> hi,
>
> i'm trying to render this html:
>
> <a class="big_button" title="clear" href="cart/clear">
> <span>clear cart !
> <img alt="arrow" src="img/clear.png"/>
> </span>
> </a>
>
>
> the best i can do is:
>
> <%= link_to content_tag(:span, image_tag("img/clear.png", :alt =>
> 'arrow')), clear_cart_path, :class => "big_button", :title => "clear"
> -%>
>
>
> any ideas???
>
> cheers.
First, I'd move the content_tag code into a helper.
def clear_cart_button
content_tag(:span, 'clear cart !' + image_tag("img/clear.png", :alt
=> 'arrow'))
end
Then in your view...
<%= link_to clear_cart_button, clear_cart_path, :class => "big_button",
:title => "clear" %>
Assuming you've added the clear_cart named route, that should work.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---