ga-wdi-exercises / project2

[project]
1 stars 30 forks source link

Displaying values #837

Closed mitchellcarroll closed 7 years ago

mitchellcarroll commented 7 years ago

Hey-

I currently have both of my models displaying on a single page. Each model has the same two keys: "category" and "value". At the moment I have the "category" being displayed under the model name. Is there a way to also display the "value" next to the "category"?

AndyWhitley commented 7 years ago

Could you add a code snippet of the related .html.erb file?

mitchellcarroll commented 7 years ago
AndyWhitley commented 7 years ago

Try this and let me know what you see:

<% @assets.each do |asset| %> <%= link_to "#{asset.category} - #{asset.value}, asset_path(asset) %> <% end %>

mitchellcarroll commented 7 years ago

thank you! that worked.