I have a problem with Active Admin. Here are the versions:
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
ruby ruby-on-rails activeadmin actionpack arbre
BPruvost
source share