Is there a way to change the indentation style of Rails templates?

If the user really wants to take advantage of the tab. Is there a way to continually style the Rails indentation style? It would be great if I could just edit some configuration file to achieve it.

For example, when I use a scaffold, "rails generate a sketch of Articals name: string", the automatically generated code has 4-space indents. So I don’t need to use an editor to convert them manually every time.

I do not ask a programming or syntax question. Rails is not a language. All this relates to settings and settings. Or I can write a program to automatically convert them in the background (not best practice).

If Rails really can't do this, will the team add it in the future?

+3
source share
2 answers

Since the OP updated the question to change the modification of the forest patterns, and not just the indentation styles, the following useful links could be a useful starting point.

You can also refer to Creating and Configuring Rails Generators and Templates for additional recommendations on modifying basic templates.

+2
source

, . , 2 .

: " ".

! , Ruby... -, git . , / 2 , .

+1

All Articles