Rails 3 Nested Forms with datamapper

Posted by jens freudenau on Stack Overflow See other posts from Stack Overflow or by jens freudenau
Published on 2012-09-23T09:34:35Z Indexed on 2012/09/23 9:37 UTC
Read the original article Hit count: 308

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 :meeting_points do |ff|
        = ff.text_field :lat
    = f.submit

But when I want to save the values I get always the error: "undefined method `readonly?' for ["lat", "14.000"]:Array"

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby-on-rails-3