To temporarily change the current working directory in Ruby, call Dir.chdir with a block. The previous working directory will be...
The first thing you need to understand is that the purpose of refinements in Ruby 2.0 is to make monkey...
If you need to do calculations inside the database and can not use Ruby objects you may run into problems...
When a has_many association basically serves to store a list of associated strings (tags, categories, ...), it can be convenient...
This card explains how to install RubyMine for the first time. If you want to upgrade an existing RubyMine installation...
Because Nokogiri needs to be compiled and dynamically linked against both libxml2 and libxslt, it has gained a reputation for...
When you just went through a long debug-fest and infested your code with dozens of debug messages, it can...
Occasionally some complex query must be processed on the database because building thousands of Ruby objects is impracticable.
E.g. when you're using a tagging gem, you have seen virtual attributes that get and set a string array...
In order to go back one page in your Cucumber tests, you can use the following step definition for Capybara...
Plugins (and gems) are typically tested using a complete sample rails application that lives in the spec folder of the...
To install webmock 1.5.0: sudo gem install webmock --version "=1.5.0" or sudo gem install webmock -v "=1.5.0"
As a user of Bundler you have spent significant time looking at this message: Fetching source index for http://rubygems.org...
Regular spaces and non-breaking spaces are hard to distinguish for a human. Instead of using the HTML entity...
Given this class: class Foo class Bar end end If you want to clean up this code with the modularity...
This is a bash script for those of you who need to install all gems for all projects (e.g. to...
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...