Skip to content
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

Bypass before_action methods #236

Closed
benjamin-thomas opened this issue Jun 15, 2017 · 0 comments
Closed

Bypass before_action methods #236

benjamin-thomas opened this issue Jun 15, 2017 · 0 comments

Comments

@benjamin-thomas
Copy link
Contributor

Could be related to issue #220.


Hi,

I've used your gem for quite a while now which I still find great.

Sometimes however, I may need to to completely override the controller's new and create methods, but not edit, destroy, etc.

I find it pretty difficult and clumsy to workaround the before_action methods that get in the way.

Due to inheritance and rails internals, I'm not sure much can be done about this.

In other words, at some point, I may want to override completely the default godmin behavior and provide my own, while still retaining the UI. At that point, I may need to override some partials, set some instance variables, but that's easier to workaround. I may even want to do without a service object.

Any thoughts?

One easy fix would be to simply not use the controller's before_action class method, but call the appropriate setters/getters directly from the index/show/edit/etc methods themselves.

Would you find any drawback with this approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant