-
Notifications
You must be signed in to change notification settings - Fork 4
New Code Formatting Conventions
In RoR Apps, most probably we deal with three main extensions .rb, .html.erb and .js/.css
In order to follow the code convention formatting in the easiest way, you will need to follow these steps with these extensions:
1- .rb files
Install ruby-beautify gem through the following command:
gem install ruby-beautify
Gem usage: write the following command on the terminal:
$rbeautify <file directory>
In this case the fixing will be done on the terminal and you should copy/paste it on your files
2- .html.erb files
Install htmlbeautifier gem through the following command:
gem install htmlbeautifier
Gem usage: write the following command on the terminal:
$htmlbeautifier <file directory>
In this case the fixing will be done automatic in the files without copy/paste
3- .js/.css files
Use the following website with its default parameters:
http://www.dirtymarkup.com/
The indentation is 4 spaces.