Best Practices for Ruby or Rails?

Any favorite links for Ruby or Rails best practices?

Here’s a few that come to mind:

I just went through the AirBnb one. So AWESOME!

Lots of good Ruby tips, such as using named capture groups rather than $1, $2.

Like this:

/\$(?<dollars>\d+)\.(?<cents>\d+)/ =~ "$3.67" #=> 0
dollars #=> "3"

This is the only issue I’ve had so far with the AirBnb guide:

Just created a PR to my fork of the AirBnb Style guide, now the RailsOnMaui style guide:

I have two suggestions re: best practices for Rails:

  1. read lots of code - see how others are doing it
  2. following the guidelines set out in “Growing Rails Applications In Practice”

GRAPI advocates a minimalistic coding style that relies on the object-oriented basics in Ruby to structure and organize your code. For me, this has made a world of difference.

This is useful:

It’s a more concise, albeit less comprehensive version of the bbatsov Style Guide

Hello, I have trouble integrating react_on_rails with my ROR application but It’s required ruby 2.3.0. How can I use react_on_rails gem with ruby 2.1.5 please help :slight_smile:

@sankima Supposedly we work with Rails 3. If you really cannot make this work with Ruby 2.1.5, please post an issue to

I just suggest reading a good code and watching how others do it (live, if you can, and video for the first time)

To make a long story short here you can find a lot of useful info

I’ve learned best from reading other people’s code and watching how other developers go about solving problems.

There are some good resources for Rails best practices here: