When you run rake db:rollback and nothing happens, you are probably missing the latest migration file (or have not...
Adds missing native PostgreSQL data types to ActiveRecord and convenient querying extensions for ActiveRecord and Arel for Rails 4.x...
When dealing with time zones in Rails, there is one key fact to keep in mind: Rails has configurable time...
When building a form with a file select field, you may want to offer your users a live preview before...
Tool to show you which gems are slow to load: ➜ git:(master) ✗ bundle exec bumbler [################################################# ] (49/65) travis-lint...
To upload a file via AJAX (e.g. from an ) you need to wrap your params in a FormData object.
If you want to inspect the compiled code of your erb (or haml) templates, you can run the following code...
Don't write resources :people, :concerns => :trashable Write resources :people do concerns :trashable end Why Writing a controller...
TL;DR There are three dimensions you can control when scoping routes: scope module: 'module', path: 'url_prefix', as: 'path...
Our preferred way of testing ActiveRecord is to simply create/update/destroy the record and then check if the expected behavior has...
Validations should be covered by a model's spec. This card shows how to test an individual validation. This is...
A HTTP 302 Found redirect to PATCH and DELETE requests will be followed with PATCH or DELETE. Redirect responses to...
From Rails 3.0.9, there is a method Hash#to_query that will turn a Hash into a query string:
I got this error when running Rails 2.3 tests for Rails LTS. More stacktrace: NoMethodError: undefined method `cache' for Gem...
Geordi is now (partially) tested with Cucumber. Yay! geordi cucumber supports a new @solo tag. Scenarios tagged with @solo...
Using Scenic, you can bring the power of SQL views to your Rails application without having to switch your schema...
You login to a Linux server with a performance issue: what do you check in the first minute? uptime
Once Rails knows a given string is html_safe, it will never escape it. However, there may be times when...
PostgreSQL offers a really handy field type: json. You can store any JSON there, in any structure. While its flexibility...
rack-mini-profiler is a powerful Swiss army knife for Rack app performance. Measure SQL queries, memory allocation and CPU...
The nokogiri gem provides different packages for several platforms. Each platform-specific variant ships pre-built binaries of libxml2, e.g...
E-mails are usually encoded using Quoted Printable. Here is how to decode or encode such strings. You probably know...
When there's a Gemfile.lock in your working directory that you cannot remove by either checkout, reset [--hard], stash, probably...
Lead by a discussion of this issue, I built in a middleware which answers those requests with [400] bad request...