When you have a Cucumber step like Then I should see "Did you see those \"quotation marks\" over there...
The code below shows a method #validate which uses Nokogiri to validate an XML document against an XSD schema. It...
You know Firebug as a Firefox extension but there is also a "Lite" version which runs purely off JavaScript.
A check if two date or time ranges A and B overlap needs to cover a lot of cases:
The difference between .bind(), .live(), and .delegate() is not always apparent. Having a clear understanding of all the differences, though...
Given those modules: module A def foo; end def bar; end end module B end When you want to call...
There are times when you need to send SQL to the database, like this: def self.some_count(field) field = connection.quote...
Then /^I should get a response with status (\d+)$/ do |status| response.status.should include(status) end Capybara Then /^I should...
This is for those who already own an SSL certificate (e.g. using it in the Apache HTTP Server) and need...
You cannot use Array#join on an array of strings where some strings are html_safe and others are not...
If you want your application to display properly on iPad, iPhone or Android there are two things to do:
Update: This trick probably isn't very useful anymore in Ruby 2.x. The Ruby GC has improved a lot...
If you’re testing the behavior of deprecated code in your Ruby project, the warning messages littered throughout your spec...
When your site is mapped into the URL-space of another server using mod_proxy, ProxyPass and ProxyPassReverse, all requests...
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...
You configured authentication in your Apache configuration that requires username and password but you want a single IP address, host...
So you added a new callback to your model that (e.g.) caches some data when it is saved. Now you...
Use the htmlentities gem. Encoding works like this: require 'htmlentities' coder = HTMLEntities.new string = "<élan>" coder.encode(string) # => "<élan>"
Deadlocks only occur if two transactions in separate threads compete for the same rows in the database. They usually (but...
You can get YAML.load to instantiate any Ruby object by embedding the desired class name into the YAML code. E.g...
If your controller spec never reaches your controller code: Make sure you are signed in. Make sure you are actually...
The first thing you need to understand is that the purpose of refinements in Ruby 2.0 is to make monkey...
When you just went through a long debug-fest and infested your code with dozens of debug messages, it can...