There are many solutions, but a very concise one is this: hash.merge!(hash) do |key, old_value, new_value|
You want to test your 1GE or 10GE internet uplink? We needed to ensure we have full 10GE to the...
When dealing with AR scopes, you can remove conditions, order, etc by using the unscope method. It is available on...
Rails 4 introduced raising an error on pending migrations. This is most annoying when you are crafting a migration but...
What is a Cookie? Google it if you do not know. How are cookies transferred between your browser and...
The asset pipeline is one of Rails' two mechanisms how stylesheets, javascripts and images from your /assets folder are processed...
Some tasks in a web application are better not done live when a user request a page, but in the...
Starting with Rails 4.0, when you get an exception reported via the ExceptionNotification gem, you will only see a very...
Rails 5 will introduce ActiveRecord::Relation#or. On Rails 4 and 3.2 you can use the activerecord_any_of gem...
To safely transport an arbitrary string within a URL, you need to percent-encode characters that have a particular meaning...
Method lookup Understand all the terms in How Ruby method lookup works, in particular: include extend singleton class
Understand how nested attributes appear in the params. See how the Rails form helpers encode the names of nested...
Many of our clients can't or don't want to design their user interfaces. In the absence of a...
In our daily life as web developers we are constantly faced with technical problems that can be solved with a...
Talk with a colleague and find out why we're using building some of our sites using static site...
We are using the BEM pattern ("Block, Element, Modifier") to structure our CSS in all new projects. We try to...
Built-in matchers Get an overview of all the matchers that are built into RSpec. Play with some of...
You may encounter problems with passenger starting an application with an updated rails. If you find an error like this...
What is rake good for? Take a look at some of the Rake tasks that Rails gives you (rake...
Read the Rails Guide about Active Record migrations Understand why we never use models in migrations. Checkout the repository...
In a web application you often need to move data between the client (HTML, Javascript) and the server (Ruby, Rails...
You can include files from app/assets or from the public folder with javascript_include_tag. The subtle difference that tells...
There is no single place to look up documentation for our stack. This card includes some hints where you can...
A word of caution There should rarely be a reason for you to split up config/routes.rb. If you need to...