I'm trying to list a user's wanted ads in their show page when they access /users/:id.
In my controller I have:
def show
@user = User.find(params[:id])
@wanted_ads = WantedAd.where(:user_id => params[:id])
And in my show.html.erb I have:
<%= @wanted_ads %>
Binding.pry says @wanted_ads is nil. On the actual page I get #<ActiveRecord::Relation:0x007fa3b5a93408>
. This is seemingly a simple thing I'm trying to do -- what am I missing?