私は2つのモデルを持っています:
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
しかし、値を保存したいときは常にエラーが発生します: "The attribute 'meeting_point' is notaccessible in Profile" in controller @profile.update(params[:profile])