Possible duplicate:
Is there a way using a helper to create button tags for sending
This is probably a pretty simple question, but I have this HTML layout:
<button class="btn btn-large btn-inverse"><i class="icon-white icon-shopping-cart"></i> Add to bag</button>
This is the add to cart button, I follow the Agile Web Development book to create a cart. The question is, with embedded HTML between the button tag, how can I display it like that? I tried this:
%= button_to raw('<i class="icon-white icon-shopping-cart"></i> Add to bag'), line_items_path(product_id: product) %>
But firstly, it prints "enter", not a button, and the text is all distorted in html, and not between the opening and closing tags.
I know that I can just write all this manually, but I was hoping to find out if there is a way to shorten this HTML code for output using rails labels, mainly because with twitter bootstrap I always see this type of HTML template ...
Any help is appreciated.
source share