Active admin: unable to access edit / edit pages

I have a problem with Active Admin. Here are the versions:

  • ruby '2.2.1'

  • rails '4.2.0'

  • activeadmin: 1.0.0.pre1

  • arbre: 1.0.3 (mention of this because it seems to be related to my problem)

We upgraded to rails 4.2 and should also have updated activeadmin (from 0.5). After a few tweaks (especially in the authorization system), everything seems fine, except for one big problem: I can only access index pages. When I go to the page with the identifier (for example: " http: // localhost: 3000 / admin / companies / 2968 "), I get this error:

There are no route matches {: action => "edit" ,: controller => "admin / companies" ,: format => nil ,: id => # {User ID: nil, [all user attributes with a null value]}}. Lack of required keys: [: id]

It seems that the [: id] parameter was somehow changed to an empty user, which, of course, violates it.

Here is what I know:

  • when installing bind.pry on top of my ApplicationController and checking the parameters, I get {: action => "edit" ,: controller => "admin / companies" ,: format => nil ,: id => 2968} (so there’s no problem )

  • lines causing the error:

active_admin / resource / show.html.arb

-> arbre / element / builder_method.rb # insert_tag

-> arbre / element / builder_method.rb # build_tag

-> actionpack / actiondispatch / travel / formatter # generate (when this method is called, the path_parameters identifier value is already corrupted, which causes an error)

Any idea why my ID parameter is not interpreted correctly / where could I look further?

EDIT β†’ I have it on my routes. rb

ActiveAdmin.routes(self) devise_for :admin_users, ActiveAdmin::Devise.config 

And the generated routes look great with rake routes (in this particular example, I have admin / companies # edit admin_company GET / admin / companies /: id (.: Format)

EDIT2 β†’ If this is not clear, this happens for all pages displayed. If I go to http: // localhost: 3000 / admin / projects / , then it works fine, but http: // localhost: 3000 / admin / projects / 23815 gives me id = empty user, and also

+7
ruby ruby-on-rails activeadmin actionpack arbre
source share
1 answer

I do not understand this problem, but 0.5 is a very old version. In my experience, we had to do the update in steps , for example. Rails 3.2 / AA 0.6 to narrow down the cause of various problems. Looking back at the old CHANGELOG , I found this fix in 0.6.1, which may be related to your problem.

0
source share

All Articles