ActiveAdmin / Inherited Resources looking for invalid route when using nested resources. Only on server, not locally

StackOverflow https://stackoverflow.com/questions/19571759

Question

I have a Rails 4 app using ActiveAdmin and nested resources. Everything is working fine on my local development version, but when I deploy to a server (Ubuntu LTS 12.04) I'm having a problem.

I have an ActiveAdmin configuration like:

ActiveAdmin.register Order do
  belongs_to :user
end

This results in a path helper of admin_user_order_path. When trying to access the orders page (/admin/users/3/orders) I get an error saying route not valid, however it's looking for admin_user_user_order_path (note the additional user)

I've traced this back as far as I can, and I've found that at line 150 of inherited_resources/class_methods.rb self.parents_symbols already is [:user] - as a result, at line 167, it becomes [:user, :user] causing the problem.

So, as a very temporary solution, on the server I've manually added this at line 150:

self.parents_symbols = []

If I try the same thing locally (where it was otherwise working), that then breaks with a different error.

My mind is a bit fried now. Can anyone shed any light on this?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top