0

i have two models:

class MeetingPoint

    include DataMapper::Resource

    belongs_to :profile

    property :id, Serial
    property :lat, String

end

and

class Profile

    include DataMapper::Resource
    has n, :meeting_points

    property :id, Serial

    property :distance, Text
    property :created_at, DateTime
    property :updated_at, DateTime

end

Now I create a form to edit the profile and the 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

But when I want to save the values I get always the error: "The attribute 'meeting_point' is not accessible in Profile" in controller @profile.update(params[:profile])

1 Answers1

0

I think there is a plugin (dm-accepts_nested_attributes) which will fix this issue -

Similar issue and more details discussed here

Narayana
  • 2,654
  • 3
  • 32
  • 32