Social Marketing

With Ror, watch out to never repeat in your code !

One of the great ideas of Rails is DRY, Do not Repeat Yourself ! Rails provides the architecture and tools needed to avoid duplicating code unnecessarily for the developers . To them to play the game up to the end. To repeat in the code is a wound : what to make if the code in question needs to change? Here you have to change all the rehearsals, which really is not easy when you accumulate many files throughout your project. So avoid repeating yourself.

There are two ways to repeat least, thanks to helpers and gems.

The helpers

Rails helpers are tools that enable sharing of Ruby code between the different views. The interest is to make lighter HTML files by moving the recurring code in a helper.

The gems

The gems are products code modules by other developers that provide functionality to your Ruby Savvy application - they are not limited to Rails. Rails itself uses some gems. The list of gems used is in the Gemfile to the root of your application. When adding a gem in Gemfile, you must download and install. These two things are done automatically with the bundle install command to the terminal. The gems are then uploaded to the site indicated in the front line of Gemfile the source. This line almost never changes. When you download an application written in Ruby, the first thing to do, is to look if there is a Gemfile. If this is the case, make a bundle install.

Rails guides developer

Rails provides many scripts for generating skeletons of these code.All these tools are based on the naming conventions of Rails and file organization.

- Project generation Script
- Model Generation Script
- Controller Generation Script
Rails provides by default a number of code generators (model, controller, webservice , mailer ... ).

Contact the best ruby on rails development company here !

Say what you think.

Les publications similaires de "SEA blog"

  1. 8 Avril 2019Understanding the needs for Php programming102 clics
  2. 2 Avril 2019We talk about the London bootcamp dedicated to web code172 clics
  3. 24 Fév. 2019What is top class Php development ?273 clics
  4. 17 Déc. 2018The importance of Php development for dynamic websites391 clics
  5. 26 Août 2018A strategic location with freedom of content and speech637 clics
  6. 25 Juin 2018All you need to know about hosting747 clics
  7. 10 Mai 2018Is Laravel ruling web development?935 clics
  8. 4 Mai 2018Setting up a PHP application1353 clics
  9. 15 Juin 2017Have a free test drive now !1793 clics