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
NoMethodError: undefined method `nested_belongs_to' for #<ActiveAdmin::ResourceDSL:0x007ff35fd05160> #3531
Comments
On you Stackoverflow post I read you want to use ActiveAdmin.register Discussion do
controller do
nested_belongs_to ...
end
end ActiveAdmin has no method |
Hey @timoschilling, yea, I've seen all these threads before posting.. And I've for sure tried to do it as you've shown, but with no luck - routes did not change and remained the same. It does not really matter how, the only thing is that I've struggled whole day today to get the correct routes, and no good so far.. |
Yes, that is what I say, ActiveAdmin don't support |
I see. So do you think I have any chance to make these nested models generate proper routes? I tried a lot of things and don't really know, how to go with that |
You can try using inherited_resources nested_belongs_to in the controller block and write your routes by hand |
Take a look at http://guides.rubyonrails.org/routing.html#routing-concerns |
Hey! Thanks a lot for assistance! I've found an acceptable work around, so I'm cool. Thanks once again! |
Hey! Here is my SO question: http://stackoverflow.com/questions/26607801/inherited-resources-issue-in-activeadmin-rails-4
I am not 100% sure it is a bug as is, but still it could be an activeadmin issue..
The problem is that routes are being built wrong.
ActiveAdmin.register Discussion
belongs_to :my_active_submission, parent_class: ClientApplication
end
works ok, and gives me
/dev_panel/my_active_submissions/:my_active_submission_id/discussions/:id
but
ActiveAdmin.register Post, namespace: :dev_panel do
belongs_to :discussion
end
gives me
/dev_panel/discussions/:discussion_id/posts/:id
instead of
/dev_panel/my_active_submissions/:my_active_submission_id/discussions/:id/posts/:id
The text was updated successfully, but these errors were encountered: