Reputation: 149
I am not familiar with ruby, but need to add a span class of money to a li item. I have tried
Orginal
<li class="list-group-item cart-text-drawer shipping-results border-0"><%= rates[i].name %> at <%= rates[i].price %></li>
My failed attempt
<li class="list-group-item cart-text-drawer shipping-results border-0"><%= rates[i].name %> at <%= :span, class: 'money' rates[i].price %></li>
Could the proper method be explained. Thanks
Upvotes: 0
Views: 80
Reputation: 40
Since span is a HTML tag you don't need to put it inside ruby code. Simply add the tag as you would do using plain HTML and add the ruby inside of it, as seen below:
<li class="list-group-item cart-text-drawer shipping-results border-0">
<%= rates[i].name %> at
<span class="money">
<%= rates[i].price %>
</span>
</li>
Upvotes: 1