0
嵌套形式,我有兩種型號:的Rails 3 DataMapper的
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
但當我想保存這些值時,我總是得到錯誤: 「屬性'meeting_point'無法訪問簡介」 在控制器 @ profile.update(PARAMS [:資料])