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

Cop Idea: Limit Controller Custom Actions #548

Open
mollerhoj opened this issue Sep 13, 2021 · 1 comment
Open

Cop Idea: Limit Controller Custom Actions #548

mollerhoj opened this issue Sep 13, 2021 · 1 comment

Comments

@mollerhoj
Copy link
Contributor

Limiting public controller actions to the 7 standard actions prevents fat controllers and generally enforces better domain modeling, as demonstrated in this talk https://www.youtube.com/watch?v=HctYHe-YjnE
and this blog post: http://jeromedalbert.com/how-dhh-organizes-his-rails-controllers/

I would like to see a rubocop that enforces that the 7 standard actions are only public methods in controllers.

This will work nicely with #547

I'm a bit confused about how to proceed. I'm not sure that my suggestion is being accepted in the style guide, though the discussion is ongoing: (rubocop/rails-style-guide#290). Is that a prerequisite for the cop to be accepted?

If I get a go from a core member, I'd love to do a PR for this cop

@koic
Copy link
Member

koic commented Apr 4, 2023

#827 is proposed as an implementation. However, the style guide is currently under discussion:
rubocop/rails-style-guide#290

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

2 participants