I'm new to the Rails framework and my boss tells me that I need to code in HAML rather then HTML, so I'm stuck trying to figure out how to convert my html.erb to HAML code. My problem is that I have the following code for a button:
<%= button_to 'Add to Cart', line_items_path(:product_id => product) %>
This button adds the product to a line item, can anyone suggest how to write the above code in HAML?
Have you tried:
= button_to 'Add to Cart', line_items_path(:product_id => product)
I went through one of my Rails apps a couple weeks ago and converted it to HAML, and it seems to me that's all I needed to do to fix those sort of things.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With