If you’re testing the behavior of deprecated code in your Ruby project, the warning messages littered throughout your spec...
Git allows you to do a binary search across commits to hunt down the commit that introduced a bug.
If you want to iterate over a Range, but only look at every n-th element, use the step method...
See our new comprehensive guide to upgrading every Rails 2 version ever.
When your site is mapped into the URL-space of another server using mod_proxy, ProxyPass and ProxyPassReverse, all requests...
Our collection of the most useful Cucumber steps, Spreewald, now supports exact matching of form fields and lets you use...
When your block takes an argument that should have an default, only in Ruby 1.9 you can say: block = lambda...
If you need to find out which of your local commits are not on the remote server do this:
I was recently confronted with the task of creating a two-column liquid layout with a header and footer in...
This must be one of the coolest, yet quite unknown, technique in Ruby. For certain types of problems (e.g. when...
In order to redirect all requests from redirecting-host.com to desired-host.com while keeping path and query params unchanged, change your Apache...
When you need to see the content of a page (i.e. not all the HTML but the relevant text body...
Learning Rails for the first time should be fun, and Rails for Zombies allows you to get your feet wet...
Styling button tags across all major browsers is not easy. Many times you should be fine by using the native...
To clear the query cache in your MySQL database manually, e.g. for database profiling, execute the following command in your...
So you added a new callback to your model that (e.g.) caches some data when it is saved. Now you...
How to write to the db 27,000 times in 24 seconds instead of 9 minutes.
You can use these step definitions: Then /^I should not see an error$/ do (200 .. 399).should include(page.status_code...
When you eagerly load an association list using the .include option, and at the same time have a .where on...
Sometimes, you just need to shoot from the hip…or deploy your local changes without committing them. Put this snippet...
If you want to find out whether a Class object is directly inheriting from another class, use superclass: ActiveRecord::RecordNotFound.super...
These two models can be used to access the posts and associated comments of a WordPress database.
To change the commit message of the latest (unpushed, unmerged) commit, you can use git commit --amend
Deadlocks only occur if two transactions in separate threads compete for the same rows in the database. They usually (but...