The following code doesn't work like expected: page.find(css_selector).find(other_css_selector) The second .find will search...

singlepageappbook.com

Great look at the tradeoffs between progressive enhancement with jQuery or similiar, vs. client-side views.

Do not pass times to date attributes. Always convert times to dates when your application uses time zones. Background

ariejan.net

Rails understands a :limit options when you create columns in a migration. Its meaning depends on the column type, and...

web.archive.org

TL;DR: You should generally use #size to count associated records. size Counts already loaded elements If the association is...

Here is a hacky way to load dumps directly from the source server, without fully copying them over and extracting...

mysqlperformanceblog.com

When MySQL refuses to use your index, there's a number of things that you may be doing wrong. One...

makandracards.com

See attached link for a way to extract the conditions of a named scope in Rails 2.3.

If you need to capture signatures on an IPad or similar device, you can use Thomas J Bradley's excellent...

rails-sqli.org

This page lists many query methods and options in ActiveRecord which do not sanitize raw SQL arguments and are not...

In our continued quest to extract proven code snippets from makandropedia into tested and upgradable gems, we have released Edge...

The Edge Rider gem gives your relations a method #traverse_association which returns a new relation by "pivoting" around a...

TLDR: Ruby class variables (@@foo) are dangerous in many ways. You should avoid them at all cost. See bottom of...

When creating an ActiveRecord with .new, .create or create!, you cannot set the ID attribute (note: When using Machinist's...

There is a bug in ActiveRecord 2.3.x that leads to changes in nested forms getting lost. class Project < ActiveRecord...

This works well in the simplified case, when your link disappears after it was clicked. Let link_to_remote behave...

rubydoc.info

When you accept a table in your Cucumber step definition, that table object will have the cryptic type Cucumber::Ast...

Defining one callback several times in the same class behaves different in ActiveRecord and ResourceController. While in ActiveRecord the callbacks...

Consul 0.6.1+ gives your Power class a number of static methods that behave neutrally in case Power.current is nil. This...

Consul 0.6.1+ gives you a way to dynamically access and query powers for a given name, model class or record...

validates_uniqueness_of is not sufficient to ensure the uniqueness of a value. The reason for this is that in...

Geordi now has a script that runs capistrano with all known deploy targets (i.e. staging, production...). Use with geordi capistrano...

When calling a scope like current_power.user?(user), Consul will no longer trigger a query if the users power selects all...

The way MySQL's FULLTEXT tokenizer splits text into word tokens might not always be what you need. E.g. it...