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

独自空忆成欢 提交于 2019-12-03 05:26:15

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/2936326/what-is-the-difference-between-erb-rhtml-and-html-erb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!