我有两个模型(Articles
和Documents
),我正在从第三个控制器(称为Share
)使用它们。我在那个控制器中编写了这个方法来跟踪文章等的点击:
def read_more(a)
@article = Article.find(a)
impressionist(@article)
end
由于某些奇怪的原因,我的应用程序试图找到Document
ID 为 17 的 a 而不是Article
. 我完全被难住了。
有任何想法吗?干杯!
编辑:
日志读数为:
Started GET "/share/read_more/17" for 127.0.0.1 at 2012-12-17 09:37:49 +1100
Processing by ShareController#show as JS
Parameters: {"ftp"=>"read_more", "id"=>"17"}
Document Load (0.1ms) SELECT "documents".* FROM "documents" WHERE "documents"."id" = ? LIMIT 1 [["id", "17"]]
Completed 500 Internal Server Error in 1ms
ActiveRecord::RecordNotFound (Couldn't find Document with id=17):