I have some data in data.json like
{
"articles": [
{
"poster": "my-image",
...
Then I load them with a loop
<% data.articles.articles.each do |article| %> <%= partial "partials/article" %> <% end %>
Then I would like to load an image in the “article” partial with the image_tag helper and “poster” as part of the src like:
<%= image_tag "posters/{article.poster}.jpg", :alt=>" ", :class=>"poster" %>
But I get "undefined local variable or method `article’ "
What’s the proper syntax ?