Reputation: 93
So I have embedded Ruby in HTML, and I need to declare a new variable which will be a manipulated version of the old variable. For instance, in
<%= newfood = food%>
if food = "AB&CSoup", I'd want the string to become "ABCSoup". After declaring the new variable in embedded ruby brackets, how can I remove the ampersand?
Upvotes: 1
Views: 122
Reputation: 2654
Try with delete method
<%= newfood = food.delete('&') %>
Upvotes: 0