rubocop-rails
rubocop-rails copied to clipboard
New cop: Prefer form_with over form_for/form_tag
As form_with
has been introduced to replace form_for
and form_tag
(https://github.com/rails/rails/issues/25197), how about a cop to check for the older tags and encourage use of the newer tag?
I'd like this cop, but I wanted to gauge everyone else's opinion before looking at a PR.
Perhaps also worth an entry in https://github.com/rubocop-hq/rails-style-guide
AFAIK, form_for
and form_tag
are not deprecated warning message yet. It would be better to respond after the deprecated warning message will be introduced. I've talked to a Rails committer @y-yagi about these APIs in the past and I agree with that idea . So I think that it's still too early.
I'm going to close this issue because RuboCop Rails currently has no plans to support template engines like ERB, Haml, and so on. Thank you for sharing this idea.