Should I use .erb or .rhtml files for a Rails application in which all the controller logic exists in the views?

I'm just starting to learn Rails. I created an empty Rails application. And instead of writing a controller, I want to put all my controller logic in my views, and not in separate controller classes.

To do this, should I use .erb files or .rhtml files and what's the difference?

+3
source share
7 answers

First of all, they are almost the same, but you should use the new standard .html.erb naming format

Secondly, stop what you are doing and review everything !!!!!

MVC , . , .

, .

+33

" . , , , , .

?

.

+11

rails 3.0.rhtml ..html.erb - .

, , MVC. /, .

+4

- . , . , , , . , , , , , , . Rails, , , , - , , .

, .

+3

, , , , .

Rails. , .

, , ? , , -, , xml , -/ , . - ASP ( )? , , ASP, . , unit test ? , , -.

, "" Ruby

, Ruby? , irb? Rails Ruby. , , Ruby, irb, Rails. Ruby, .

, , , , , , - . , , -: ASP, ASP.Net, PHP, JSP, Perl, Ruby rails, , -.

+1

MVC - . , . , . , . .

+1

, . Rails 1 Rails 2. Rails 2 .rhtml, file.rxml file.rjs. Rails file.content_type.template_engine. , file.html.erb, - html, - ERb. rxml xml.builder, rjs ( ) js.rjs

The new rails 3.0.rhtml files will not be supported .. html.erb is the new standard.

0
source

Source: https://habr.com/ru/post/1707614/


All Articles