ok. so iâ€™ve got two models, Photo and Place:
class Photo < ActiveRecord::Base
belongs_to :place, :counter_cache => true
class Place < ActiveRecord::Base
acts_as_tree :order => "name" has_many :photo
the places database contains specific locations, cities, and states. the
specific locations connect to cities by parent_id and in turn cities
connect to states by parent_id.
each Photo belongs to a Place, referencing to a place_id in the photos
for some reason, i canâ€™t get the one-to-many relationship to work out.
when i put
<%= place.photos.size %>
in a view, i get a NoMethodError saying that â€˜photosâ€™ is an undefined
method of the Place model.