So in my view, I am displaying the prices for Shirts, which belong to a Products category. In my view, I am currently looking through an array of shirts like so:
<% @shirts.get_shirts("red", "small").each do |shirt| %>
<%= shirt.price ">
<% end %>
This works just like I want, displaying only the prices for shirts that are red and small.
However, when I try to move this logic into the corresponding helper, it displays the full object data instead of just the prices. My helper code is below:
def show_prices(color, size)
@shirts.get_shirts(color, size).each do |shirt|
shirt.price
end
end
and I calling it in the view like so:
<%= show_prices("red","small") %>
What am I doing wrong in the helper? It seems like it should just do the same thing but it is not.