Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accepts_nested_attributes_for not working (in v 1.0.0) #2722

Closed
Jamevidi opened this issue Sep 26, 2016 · 5 comments
Closed

Accepts_nested_attributes_for not working (in v 1.0.0) #2722

Jamevidi opened this issue Sep 26, 2016 · 5 comments

Comments

@Jamevidi
Copy link

Jamevidi commented Sep 26, 2016

Firstly, AWESOME JOB with version 1.0.0! :) :) :)

The example:

  1. accepts_nested_attributes_for :comments
  2. Comment model has belongs_to :post (so should create a ui-autocomplete-input)..but gives the error:
    "Uncaught TypeError: Cannot set property '_renderItem' of undefined"

Please see attached pic.

I tried with different projects and models and nothing worked.

Rails admin 1.0.0
Rails 5.0.1

screen shot 2559-09-26 at 9 25 00 pm

Thanks again! :)

@demoabc
Copy link

demoabc commented Sep 27, 2016

+1
I also have this problem with Rails admin 1.0.0.
I work with rails 4.2.1 and mongoid.

@Jamevidi Jamevidi changed the title Uncaught TypeError: Cannot set property '_renderItem' of undefined Accepts_nested_attributes_for broken Sep 27, 2016
@Jamevidi Jamevidi changed the title Accepts_nested_attributes_for broken Accepts_nested_attributes_for broken (in v 1.0.0) Sep 27, 2016
@Jamevidi Jamevidi changed the title Accepts_nested_attributes_for broken (in v 1.0.0) Accepts_nested_attributes_for not working (in v 1.0.0) Sep 28, 2016
@Jamevidi
Copy link
Author

RailsAdmin 0.6.6 and Rails 5.0.0 seems to work well with very nested forms :)

If someone wants to try it out:

  1. In gemfile
    gem 'nested_form'
    gem 'safe_yaml'
    gem "font-awesome-rails"
    gem 'rack-pjax', github: 'afcapel/rack-pjax'
    gem 'remotipart', github: 'mshibuya/remotipart'
    gem 'rails_admin', '0.6.6', :path => 'vendor/rails_admin-0.6.6'
  2. In ra.nested-form-hooks.coffe
    Replace "a[href=" with "a[href=" .....find and replace in editor
  3. In property.rb
    replace "model.serialized_attributes[property.name.to_s]" with "model.type_for_attribute(property.name).class == ::ActiveRecord::Type::Serialized"

@ericchapman
Copy link

I am seeing the same thing. It appears to only happen when the array is empty

@benhutton
Copy link

We are seeing this as well. Anybody have a workaround or an idea at a fix?

@hchasey
Copy link

hchasey commented Oct 10, 2016

+1 — same issue here....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants