我有两个模型:
class MeetingPoint
include DataMapper::Resource
belongs_to :profile
property :id, Serial
property :lat, String
end
和
class Profile
include DataMapper::Resource
has n, :meeting_points
property :id, Serial
property :distance, Text
property :created_at, DateTime
property :updated_at, DateTime
end
现在我创建一个表单来编辑配置文件和 meeting_poing:
= form_for @profile do |f|
= f.text_field :distance
= f.fields_for @profile.meeting_points do |ff|
= ff.text_field :lat
= f.submit
但是当我想保存值时,我总是会收到错误:控制器@profile.update(params [:profile])中的“属性'meeting_point'在配置文件中不可访问”