Terminus is a Capybara driver where most of the driver functions are implemented in client-side JavaScript. It lets you...
Sometimes you inherit a non Rails or non Rack based web app such as PHP, Perl, Java / JEE, etc. I...
After switching to Rails 3 you may get a LoadError with the following message when trying to use your application...
You will need to upgrade to RSpec >= 2 and rspec-rails >= 2 for Rails 3. Here are some hints to...
I prefer the application that I'm currently working on to be reachable at http://localhost/. So when I switch...
Be careful when memoizing a method that returns a scope, e.g.: def variants scoped(:conditions => { :name => name }) end memoize :variants...
The ancestry gem allows you to easily use tree structures in your Rails application. There is one somewhat unobvious pitfall...
You need to install the following packages before you can build the Nokogiri gem: sudo apt-get install libxml2-dev...
If you get an error message like that you are missing the Aspell files a specific language:
Hooks lets you define hooks declaratively in your ruby class. You can add callbacks to your hook, which will be...
Even when you're using bundler, it might be significant in which order your gems are listed in your Gemfile...
This post will describe how I stumbled upon a code path in the Linux kernel which allows external programs to...
It can be useful to have a Ruby expression like condition ? positive_case : negative_case in MySQL queries:
[ ] [ ]= ** ! ~ + - * / % + - >> << & ^ | <= < > >= <=> == === != =~ !~ && || .. ... ? : = %= { /= -= += |= &= >>= <<= *= &&= ||= **= defined? not or and if unless while until begin/end For more information see Table 18.4 in The Pragmatic Programmer's...
A good tool to generate strong passwords and secrets is "apg". You can get it with sudo apt-get install...
Ruby gem that provides an AR-style interface for the Pivotal Tracker API.
You need to install the following packages before you can build the Paperclip gem: sudo apt-get install imagemagick librmagick...
A popular ruby idiom I keep stumbling upon is def do_some_thing_for(values) values = Array(values)
You can use record.send(:update_without_callbacks) or record.send(:create_without_callbacks) This can be used as a...
You don't need a Rails application to use Sass. Even when you're working on a static site you...
Find conditions for scopes can be given either as an array (:conditions => ['state = ?', 'draft']) or a hash (:conditions => { 'state' => 'draft...
power-rake db:migrate VERSION=20100913132321 By default the environments development, test, cucumber and performance are considered...
There are many different methods that allow mapping an Array to a Hash in Ruby. Array#to_h with a...
Do that for noble reasons only.