0
在我的Rails應用程序中,我使用了命名範圍。命名範圍 - 傳遞參數[:id]
我想知道是否有可能傳遞參數,例如params [:id]或@ batch.batch_id到指定的範圍。
image.rb:
named_scope :batch_images, lambda {
{ :conditions => ["IMG_BATCH = ?",@batch.batch_id ]
}
}
目前上面的代碼是給我爲零的錯誤消息 '未定義的方法`BATCH_ID':NilClass。
的幫助