NoobOnRails

Ruby on Rails tips, tricks and hints for the aspiring rails hero.



Wednesday, February 21, 2007

Goodbye .rhtml, we knew you well


So I hope you didn't have any emotional attachments to the .rhtml extension because accroding to the recent changeset 6178 it is on it's way out. Say goodbye to the the .rhtml and .rxml extensions and hello the the .erb and .builder extensions. Why, you ask? as to make it a point that the extension shouldn't determine the content. Here's the message form the changelog...

Added .erb and .builder as preferred aliases to the now deprecated .rhtml and .rxml extensions [Chad Fowler]. This is done to separate the renderer from the mime type. .erb templates are often used to render emails, atom, csv, whatever. So labeling them .rhtml doesn't make too much sense. The same goes for .rxml, which can be used to build everything from HTML to Atom to whatever. .rhtml and .rxml will continue to work until Rails 3.0, though. So this is a slow phasing out. All generators and examples will start using the new aliases, though.


So you don't have to completely stop using it right this very second today since you have until Rails 3 dot Oh to phase out the old extensions but it wouldn't hurt to start getting used to the new extensions.

Labels: ,

0 Comments:

Post a Comment

<< Home