What is the difference Between .erb , .rhtml and .

2019-03-09 19:34发布

What is the difference Between .erb, .rhtml and .html.erb?

1条回答
迷人小祖宗
2楼-- · 2019-03-09 20:10

Nothing, really. It’s just a change of philosophy between Rails 1 and Rails 2. Before Rails 2, you had file.rhtml, file.rxml and file.rjs. In Rails, that changed to file.content_type.template_engine. So with file.html.erb, the content type is html and the template engine is ERb. rxml is now xml.builder and rjs should now (mostly) be js.rjs

In the new rails 3.0 .rhtml files will be unsupported. .html.erb is the new standard.

查看更多
登录 后发表回答