Skip to content

New Code Formatting Conventions

karim-elbawab edited this page May 6, 2014 · 1 revision

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.