2
錯誤使用關係
uninitialized constant Suspicious::Activity::SuspiciousPerson
模型結構
app
models
suspicious
activity.rb
person.rb
模型類
class Suspicious::Activity < ActiveRecord::Base
has_many :suspicious_people, :dependent => :destroy
accepts_nested_attributes_for :suspicious_people, :allow_destroy => true
class Suspicious::Person < ActiveRecord::Base
belongs_to :suspicious_activity
這就是發生錯誤[3號線]
1 def new
2 @activity = Suspicious::Activity.new
3 @activity.suspicious_people.build
4 end