Delegating methods to other objects is often helpful but the syntax of both def_delegators and def_delegator is a...
In MySQL comparing zero to a string 0 = "any string" is always true! So when you want to compare a...
When your gems complain about invalid gemspecs and illformed requirements, it is most probably an error resulting from the transition...
REST Client is a nice, simple HTTP client library for Ruby. When you do a simple GET request like that...
Don't you just hate to write Cucumber path helpers to be able to say this?
The attached patch lets you find a record by a string or number in any column: User.find_by_anything('carla...
In order to save the original value of a constant, set the new value and restore the old value after...
Copy the attached file to config/initializers/indent_string.rb and you can say "foo".indent(4) # " foo" Note you will find many simpler...
Imagine you have a piece of code that tries to send a request to a remote server. Now the server...
Tooltips that are delivered through HTML attributes are encoded. Decode entities before checking for their presence. Capybara: Then /^there should...
Sometimes it might be helpful to have a version history for a gem, e.g. when you want to see if...
Ever seen this error when using Graticule? Numerical argument out of domain - acos Similarly to the to_sql problem for...
You can use text-overflow to truncate a text using CSS but it does not fit fancy requirements.
When using Rails to truncate strings, you may end up with strings that are still too long for their container...
ProgressBar is a simple Ruby library for displaying progress of long-running tasks on the console. It is intended to...
If Sunspot does not work and fails with a backtrace similar to this: /project/shared/bundle/ruby/1.8/gems/rsolr-1.0.6/lib/rsolr/client.rb:227:in `adapt_response' /project/shared/bundle/ruby/1.8/gems/rsolr-1.0.6/lib/rsolr/client.rb:164...
If you defined your association via class Article belongs_to "category" end and you try Article.scoped(:include => :category)
Saying git diff only shows unstaged changes relative to the index (or HEAD if the index is empty, alternatively any...
The following snippet demonstrates how you could create excel files (with spreadsheet gem) and format columns so that they follow...
This describes all the steps you'll need to get Solr up and running for your project using the Sunspot...
Views are normally (for good reason) not rendered in controller specs. If you need it to happen, use:
Gem to get Ruby 1.9 features in Ruby 1.8.
Code coverage for Ruby 1.9 with a powerful configuration library and automatic merging of coverage across test suites.
Sometimes you want one distinct version of RubyGems to be installed to replicate the same behavior across multiple servers.