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

Pull resource methods into their own controllers #104

Open
sipple opened this issue Jul 28, 2014 · 1 comment
Open

Pull resource methods into their own controllers #104

sipple opened this issue Jul 28, 2014 · 1 comment

Comments

@sipple
Copy link
Contributor

sipple commented Jul 28, 2014

This needs to not be happening: https://github.com/pgharts/trusty-cms/blob/master/app/controllers/admin/resource_controller.rb#L58-L65

Currently, all resources methods in admin go through one controller, where a class_eval handles all the work of showing, updating, creating, etc. This makes it impossible to do things without mass assignment, and it's also just not great API design.

Pulling these out into their own controllers is a chunk of work but, ultimately, worth it. The reason I don't want to do this yet is because I'm not sure how this will impact extensions and will need a better handle on that before I go about mucking with this.

After Snippets and Assets are integrated, we can make a decision from there.

@sipple
Copy link
Contributor Author

sipple commented Jul 28, 2014

More information on this:

All resource controllers in Admin inherit from ResourceController, so some override ResourceController's create/update methods with their own, and some do not. That makes fixing this a bit easier, as we can pick at them one at a time without rewiring everything, and without breaking existing functionality. I might tackle this for Users for #91 to see how it works.

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

No branches or pull requests

1 participant