I am trying to write a simple application and I am stumped!
Here is what I have as a view for users/show/1:
<p>
<b>User:</b>
<%=h @user.login %>
</p>
<% if @user.reviews.empty? %>
No Analyst Reports yet
<% else %>
<% for review in @user.reviews %>
<%= review.vendor_id %><%= review.summary %><br />
<hr class="span-5" />
<% end %>
<% end %>
I created a relationship where user :has_many reviews and vendor :has_many reviews
So I assume that there should be a value for review.vendor_id, where vendor_id is just automatically created and can be displayed.
Thank you :)
Here is my Reviews model:
class Review < ActiveRecord::Base
belongs_to :vendor
belongs_to :user
end
Actually this has been solved, I now need to go through the for-loop and display attributes of vendor....see my other question please! Thanks!