title: Embedded HTML in button tag rails button_to
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2254720/is-there-a-way-with-rails-form-helper-to-produce-a-button-tag-for-submit">Is there a way with rails form helper to produce a button tag for submit</a>  </p>
  </blockquote>
  
  
  
  <p>This is probably quite an easy question, but I've got this HTML layout:</p>
  
  <pre><code>&lt;button class="btn btn-large btn-inverse"&gt;&lt;i class="icon-white icon-shopping-cart"&gt;&lt;/i&gt; Add to bag&lt;/button&gt; 
  </code></pre>
  
  <p>This is an add to cart button, I'm following along the book Agile Web Development to create a cart. Question is, with embedded HTML between the button tag, how do I get it to render like that? I tried this:</p>
  
  <pre><code>%= button_to raw('&lt;i class="icon-white icon-shopping-cart"&gt;&lt;/i&gt; Add to bag'), line_items_path(product_id: product) %&gt;
  </code></pre>
  
  <p>But firstly it prints an "input" not a button, and the text is all askew in the html and not between opening and closing tags.</p>
  
  <p>I know I can just write it all manually, but was hoping to figure out if there's a shortcut way to do this HTML to output using the rails tags, mainly because with twitter bootstrap I see this type of HTML pattern all the time...</p>
  
  <p>Any help is appreciated.</p>