I basically want to do this:
<% @videos.each do |vid| %>
<div id=vid.location>
...
<% end %>
how do I evaluate vid.locaion and use it as the id attribute?
i’ve tried the above, id="#{vid.location}" and id="<% vid.location %>" (the last one with and without quotes.
any help appreciated
Easy,
Your first attempt was wrong as you’re still in markup – not ruby. In the last one you used
<%rather than<%=, so while it was evaluating the getter, it just didn’t present it to your view.