Development environment setup Rails Composer Basically a comprehensive Rails Template. Prepares your development environment and lets you select web server...
rake stats # => LOC per controllers, models, helpers; code ratios, and more rake notes # => collects TODO, FIXME and...
Just found out about a great feature in Rails that seems to be around since Rails 2. Start a console...
Browsers usually cache favicons. If you update the favicon of your web site and want all visitors to see the...
Eduardo Russo was tired of complex favicon creation and created his own favicon generator. It's really easy and allows...
String#indent is not a standard Ruby method. When you use it, be sure to know where this method comes...
You might have a table without a primary key set in MySQL. You can fix this by adding a primary...
Usually, Cucumber feature files live in features/. When you group them in sub directories, make sure to add -r features...
Arel is a library that was introduced in Rails 3 for use in constructing SQL queries. Every time you pass...
class Book::Page end class MyBook < Book def new_page Page.new # has to be `Book::Page` in development to...
At TaskRabbit, we have gone through a few iterations on how we make our app(s). In the beginning, there...
Rails 4.0 introduced a helpful new method for ActiveRecord queries: where.not. It can make clunky queries easier to read.
If your terminal has many tabs, you'll want to keep them organized. To change their title from the prompt...
There seems to be no way to use therubyracer -v '0.11.4' and libv8 -v '3.11.8.17' on OS X Mavericks.
A MySQL DECIMAL column is used when it is important to preserve exact precision. It takes two parameters, where...
When you do something like this in your code: def var_value @var ||= some_expensive_calculation end
If you have a FooController and also have a layout app/views/layouts/foo.html, Rails will use this without being told so.
TLDR: This card explains which threads and processes interact with each other when you run a Selenium test with Capybara...
tl;dr: Using has_many associations with a :through option can lead to lost or duplicate records. You should avoid...
On recent/fresh installations of Ruby 1.8.7 you may encounter this error why calling any bundled binary (or just bundle exec...
We've since created ActiveType which has a restricted subset of Virtus' features. It might be enough for your needs...
In Ruby, classes and modules are called constants. This card explains how Ruby resolves the meaning of a constant.
Modern IRB has time measurement built in. measure # Enable measure :off # Disable Custom Should your version of IRB not offer...
Before Rails 3.2.14, when supplying an invalid locale to I18n, it would fall back to its config.i18n.default_locale (which is...