我在这里检查了所有其他问题,但似乎找不到答案。我有
小路:
attr_accessible :location, :total_time, :visits
belongs_to :trackedsite, :touch => true
跟踪站点:
attr_accessible :total_time, :url, :visits
has_many :paths, :autosave => true
我想找到属于具有特定位置的 Trackedsite 的路径
我试过了:
@trackedsite = Trackedsite.find_by_url(params[:url_string])
@path = @trackedsite.find_by_location(params[:path_string])
但是我得到“没有这样的列:paths.trackedsite_id”(这是正确的,该列不存在,我应该在迁移中添加一些东西吗?)