Hi, I'm a novice and could use help with a join table question. I have
a join table "galleries_questions".
I can't figure out how to query it for pictures in a selected gallery.
Controller:
@gallery = Gallery.where("minisection_id" =>
session[:minisection_id]).first
@pictures = Gallery.find(@gallery).pictures
View:
<% @pictures.each do |picture| %>
<%= image_tag picture.image_url.to_s %>
ERROR:
PGError: ERROR: column pictures.gallery_id does not exist
LINE 1: SELECT "pictures".* FROM "pictures" WHERE "pictures"."galle...
^
: SELECT "pictures".* FROM "pictures" WHERE "pictures"."gallery_id" =
11
Any suggestions?
Thanks
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment