activeadmin: Filter and form do not honor scope_to :current_user
scope_to :current_user
is set in ActiveAdmin.register
If I set a filter for an association to filter :folder, :as => :select
it will call Folder.all
.
If I try to set filter :folder, :as => :select, :collection => current_user.folders.all
rails fails with a current_user not found
error.
if scope is set the filter method should scope the association to the current_users objects.
About this issue
- Original URL
- State: closed
- Created 13 years ago
- Comments: 43 (14 by maintainers)
Commits related to this issue
- Eval filter's collections in the context of the view. Issue #70 When defining a filter, you can pass a collection that will be rendered within the context of the view. For example: ActiveAdmin.regis... — committed to activeadmin/activeadmin by gregbell 12 years ago
- Issue #70 - Form blocks are now eval'd in the context of the view You can now do: ActiveAdmin.register Post do form do if current_admin_user.super_admin? f.inputs "For Su... — committed to activeadmin/activeadmin by gregbell 12 years ago
For the form, I confirm that you can do:
Whoa, slow it down there @cgunnels!
This is open source and you are not paying for it. @gregbell (and others) have put in a lot of work to ensure that ActiveAdmin works for the majority of its users. I’m quite thankful for that.
If it’s as big of an issue as you’re making it out to be then I think it’s time to get your hands dirty and contribute some code.