裏面我有一個Rails模型類導軌的has_many和訪問
class Model < ActiveRecord::Base
has_many :object_collection
def add_object(object)
object_collection.push object // works
@object_collection.push object // does not work
self.object_collection.push object // works
end
end
我想知道如果有人能請向我解釋爲什麼@尚不能工作自做我認爲這兩個意思相同
歡呼聲
所有的好回答歡呼傢伙, – ssmithstone 2009-06-22 21:44:29