An association defined with has_many :through will return the same record multiple times if multiple join models for the...

After installing Bundler 1.1 you will get the following warning when running tests: WARNING: Cucumber-rails required outside of env.rb...

This card needs to be updated for Rails 3+. Since there is no --debugger flag you need to run:

You won't usually have to do this. It's OK to route all formats to a controller, and let...

stackoverflow.com

This will give you the string that appears most often in an array: names = %w[ foo foo bar bar bar...

When you regularly make use of Cucumber's "show me the page" step (or let pages pop up as errors...

slate.com

Nice article to educate your non-geek girlfriend/boyfriend about the joys of programming.

github.com

Pour color on your Rails console with awesome_print. Turn confusing long strings into formatted output. Have objects and classes...

Install libreadline: sudo apt-get install libreadline-dev Reinstall the ruby and tell rvm where to find readline

This only applies to RSpec below version 1.3.2. The issue has been fixed in RSpec 1.3.2, and most likely RSpec...

Let's say you need to revert a migration that happened a while back. You'd create a new migration...

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...

The attached patch lets you find a record by a string or number in any column: User.find_by_anything('carla...

Sometimes it might be helpful to have a version history for a gem, e.g. when you want to see if...

When using Rails to truncate strings, you may end up with strings that are still too long for their container...

Possible Reason 1: parallel_tests - running more processes than features If you run old versions of parallel_tests with more...

Views are normally (for good reason) not rendered in controller specs. If you need it to happen, use:

makandra dev
github.com

Gem to get Rails 3's new ActiveRecord query interface (where, order) and the new scope syntax (chaining scope definitions...

Using .downcase or .upcase on strings containing umlauts does not work as expected in Ruby versions before 2.4. It leaves...

blog.bitcrowd.net

To make the RSpec matcher of the authorization solution Consul work with Rspec 2.x read the following blog post...

Although it's tempting flirt with detecting mobile/touch devices with CSS media queries or Javascript feature detection alone, this approach...

Basically, you now need to know if your project uses a "real" time zone or :local, and if config.active_record.time_zone...

localeapp.com

A possible way for localisation in Rails applications that allows editing translations remotely.