I am using active_admin and devise in a project. There is an admin page to invite users that won't even load at all. I have tried removing quite a bit of code to get some clues as to what is going on. All I get is the following error.
NoMethodError in Admin/invitations#index
Showing /Users/ianseabock/.rvm/gems/ruby-1.9.3-p448/gems/activeadmin-0.6.2/app/views/active_admin/resource/index.html.arb where line #1 raised:
undefined method `storage_total_stat_id_eq' for #<MetaSearch::Searches::User:0x007fb9ebde5ce0>
Extracted source (around line #1):
1: insert_tag renderer_for(:index)
The undefined method "storage_total_stat_id_eq" is no where to be found in the codebase. Any suggestions on what's going on?
It sounds like this is caused by an association that Active Admin is trying to build a filter for, but I'm guessing the association is non-standard. You can see which filters are being built by default with this bit of code:
ActiveAdmin.application.namespaces[:admin].resources[:User].filters
A quick fix would be to remove that filter:
ActiveAdmin.register User do
# ...
remove_filter :storage_total_stat
# ...
end
Check to see if you have included the storage_total_stat_id
has been included in the permitted parameters:
ActiveAdmin.register Invitation do
permit_params :storage_total_stat_id, :other, :attributes, :for, :this, :model
end
I had a similar problem - and for me it was that my Active Admin form included a "collection" filter that was incorrectly specified.
I had used User.all.where(...) instead of User.where(...).
Once I removed the ".all", it fixed the problem.