Topic: Join table query
I'm learning Rails and can't figure out how to query the join table I created...
The join table is "galleries_pictures" and I am trying to retrieve all pictures from the selected gallery.
@gallery = Gallery.where("minisection_id" => session[:minisection_id]).first
@pictures = Gallery.find(@gallery.id).pictures
<% @pictures.each do |picture| %>
<%= image_tag picture.image_url %>
@gallery does contain the correct gallery, but @pictures returns empty even though there is a picture record in the table.
Last edited by dcastellano1 (2013-05-02 14:02:53)