PROPOSAL: Rails generator filename extensions

Since my last proposal was so roundly applauded...

Today, Rails templates all use the filename extensions of their target
files - a template that will become an .rb file ends in .rb.

But they're not .rb files; they're .erb files. They are not
necessarily valid Ruby. And this conflicts with a wonderful Eclipse
feature (supported by Aptana RadRails/RDT) where files with syntax
errors - and all parent folders of those files - have their icons
decorated with a red "x" so you can see if something in your project
is broken. Since all my projects use edge rails in vendor/rails, all
my projects appear to be broken all the time.

How would folks feel about a patch that (a) changes the generator to
allow (but not require) template files ending in .rb.erb, .txt.erb,
etc., and (b) changes the built-in Rails generators to use .erb?
Rails 2.0 is already doing a mass rename of view files, so this would
fit right in; it wouldn't affect those of you using TextMate, and it
shouldn't break backward compatibility for any custom generators
either.

How would folks feel about a patch that (a) changes the generator to
allow (but not require) template files ending in .rb.erb, .txt.erb,
etc., and (b) changes the built-in Rails generators to use .erb?
Rails 2.0 is already doing a mass rename of view files, so this would
fit right in; it wouldn't affect those of you using TextMate, and it
shouldn't break backward compatibility for any custom generators
either.

I am confused - isn't this already the case? Generated files all end
in .html.erb

http://dev.rubyonrails.org/changeset/6690

I am confused - isn't this already the case? Generated files all end
in .html.erb

http://dev.rubyonrails.org/changeset/6690

Oh, I see what you mean now, I really was confused. The templates used
to generate those files - not the view files themselves.

Nevermind...

+1

Jay Levitt wrote:

+1

The template files also cause rdoc to choke and die when you run it on
railties. Having them end in .erb would eliminate that problem as
well.

V/r
Anthony