助けが必要です。私は2つのクラスを持っています:
共有情報
class SharedInfo < ActiveRecord::Base
attr_accessible :shared_info_type_id, :severity_id, :source_info_id, :created_date
belongs_to :Severity, :foreign_key => :severity_id
belongs_to :SharedInfoType, :foreign_key => :shared_info_type_id
belongs_to :SourceInfo, :foreign_key => :source_info_id
end
重大度
class Severity < ActiveRecord::Base
has_many :SharedInfo, :foreign_key => :severity_id
end
問題は次のとおりです。クラス
のインスタンスがあります。次のステートメントを呼び出すと:@sharedinfo
SharedInfo
@sharedinfo.Severity
エラーを返します:「未定義」。私は何を間違っていますか?