Rails 4 Way!

I started reading Rails 4 Way by Obie Fernandez, Kevin Faustino and Vitaly Kushner, as a part of my study to revisit ruby on rails, as I am not working for one and half years. I have finished one chapter today and so far very much liked the way it started and going. Its a bit advanced not like a beginner book. Its started with the most important thing that Rails offer: conventional over configuration. So, the first chapter mostly talked about bundler, gemfiles, all environment files, initializer, logs etc. This is a summary of the first chapter: some lines copied from the book:

  • bundle install will install all the gems and their dependencies found in Gemfile and update Gemfile.lock to lock whats installed. (Every time you install or update, Bundler calculates the dependency tree for your application and stores
    the results in a file named Gemfile.lock)
  • All the gems can be packaged by bundle in the vendor/cache directory inside the Rails application so that no need to connect to rubygems.com
  • There are three files involved in setting up the entire Rails stack:
    • boot.rb: sets up Bundler and load paths
    • application.rb: loads rails gems, gems for the specified Rail.env, and configures the application
    • environment.rb: runs all initializers
  • To speed up the boot time of starting a Rails server during development, code is no longer eager loaded. This behavior is governed by the config.eager_load setting:
    • config.eager_load = false
  • Caching is false in development mode
    • config.action_controller.perform_caching = false

This chapter has very detailed information on all different kind of configuration, also the one we can separate for each environments.

Leave a comment