Calling bundle update GEMNAME will update a lot more gems than you think. E.g. when you do this...
Calling bundle update (without arguments) updates all your gems at once. Given that many gems don't care about stable...
You can define methods in any example group using Ruby's def keyword or define_method method. These helper methods...
Basic error pages To add a few basic styles to the default error pages in Rails, just edit the default...
Git commits should be very deliberate, and only contain changes that you really want to be in there. In order...
When you have two models in a has_many, has_one or belongs_to association, the :inverse_of option in...
simple_format ignores Rails' XSS protection. Even when called with an unsafe string, HTML characters will not be escaped or...
Note: Modern Rails has two build pipelines, the asset pipeline (or "Sprockets") and Webpacker. The principles below apply for both...
Tempfiles get deleted automatically With the the ruby Tempfile class you can create temporary files. Those files only stick around...
In a nutshell: Use git rebase --onto target-branch source-commit target-branch means "branch you want to be based...
When deploying, Capistrano puts a REVISION file into your application's release directory. It contains the hash of the commit...
Sometimes you need to remove high Unicode characters from a string, so all characters have a code point between 0...
Recent rails security updates have shown that people make incorrect assumptions about the possible contents of the params hash.
If you're suffering from a huge de.yml or similiar file, cry no more. Rails lets you freely organize your...
Localizing a non-trivial application can be a huge undertaking. This card will give you an overview over the many...
When requests arrive at the application servers simultaneously, weird things can happen. Sometimes, this can also happen if a user...
By default, Google Analytics tracks the current URL for every request. Sometimes you will want to track another URL instead...
An association defined with has_many :through will return the same record multiple times if multiple join models for the...
You can change which branches will be pushed when saying git push. Our recommendation is to set it to current...
TL;DR {} binds stronger than do … end (as always in Ruby, special characters bind stronger than words) Demo
The following two hints are taken from Github's Ruby style guide: If your regular expression mentions a lot of...
When you are calling a method that may raise an exception that you don't care about, you might think...
If your project manager wants to do gatekeeping on a project, as a developer you need to follow the following...
When your model is using a callback like before_save or before_validation to calculate an aggregated value from its...