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

Default controller projection to ApplicationController #570

Closed
wants to merge 1 commit into from

Conversation

m1foley
Copy link
Contributor

@m1foley m1foley commented Dec 3, 2020

Similar to how :Einitializer with no arguments defaults to the routes file, :Econtroller with no arguments should default to ApplicationController. This seems like a reasonable default because AFAICT all Rails applications are generated with this as the default top-level controller (even with the --api option).

This PR has the side effect of creating application_controller.rb if it doesn't exist. That seems unexpected to me, but I couldn't figure out an implementation that doesn't do that.

Similar to how `:Einitializer` with no arguments defaults to the routes
file, `:Econtroller` with no arguments should default to
`ApplicationController`. This seems like a reasonable default because
AFAICT all Rails applications are generated with this as the default
top-level controller (even when the `--api` option is used).
@tpope
Copy link
Owner

tpope commented Dec 3, 2020

There's already a default, based on the file you are currently editing.

@tpope tpope closed this Dec 3, 2020
@m1foley m1foley deleted the econtroller-default branch December 3, 2020 21:32
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

Successfully merging this pull request may close these issues.

2 participants