Correct me if I'm wrong but I think forms in Rails do this by default.
edited to add: This seems related to a problem various "try to sound like English" programming languages (e.g. Inform) have, where it is easy to assume invalid syntax will be valid because it's valid English.
EDIT: found the commit with some git log magic - https://github.com/rails/rails/commit/c616089