-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access to controller primitives? #2682
Comments
@mshibuya any thoughts? |
This topic appears to be too broad... Accessing the controller instance:Controller actions are Eager loading, Overriding search, UnscopingThese features are to be implemented through specifically-designed RailsAdmin-ish DSL, not monkey-patching. If you have new DSL idea, please feel free to open PR and we'll discuss it there. |
Thanks for writing back! I am specifically not referring to custom actions, but to a scenario where I want to, e.g. add eager loading to a model in an action. I shouldn't need to wait for RailsAdmin to promote that to a DSL, right? Right now, I think the ways to do it are both hacks:
This lack of access to what I'm calling 'controller primitives' was also a problem for me in a previous project that used ActiveAdmin. The DSL is great, but exposing a 'controller do' or 'super do' would make a lot of my struggles with customizing our admin easier. I know Rails pretty well, and maybe that's part of my problem :) Does that help? Or any of the referenced issues? |
I've already made a solution for eager-loading, creating DSL is just so simple. |
@mshibuya but, unless I'm misunderstanding, the only way for me to make the change in that ref is by a PR to the repo, whereas what I'm interested in is not needing to do that. I think that with the changeset in #2649 I could have used a hack to access the controller by taking advantage of 'render'. Or, more directly, how could I have gotten the behavior of b92a4d1 without a PR to rails_admin? |
If this exists, I can't find it, but is there a place where, either in an action or in a configuration, that I can access the controller class or instance? It'd make working with RailsAdmin a lot easier if I had access to what I'm calling the primitives-- the things every Rails dev knows, even if they can't figure something out using the RailsAdmin DSL.
When I make a custom action I controller the proc that is evaluated in the control. Would be nice if the built-in controller proc's called out to some method hook I could use.
I know there's a MainController and I know there are actions, but I don't know what to modify them per generated controller or controller action.
This would be particularly useful for fixing N+1 queries.
There's a lot of people monkeypatching RailsAdmin to be able to do these kinds of things :(
I'm happy to help, but thus far my efforts have failed. Any guidance is appreciated.
Related:
Possibly Related:
The text was updated successfully, but these errors were encountered: