In Rails 3.1+, instead of defining a separate up and down method you can define a single method change:

ruby-lang.org

It's the last bugfix release. We will get another year of security fixes, then no more patches.

github.com

In moderately complex authorization scenarios you will often find yourself writing a map like this: class NotesController < ApplicationController power :notes...

ActiveSupport::Memoizable will be removed from Rails and has a lot of strange caveats that will ruin your day.

martinciu.com

How to make class_attribute behave like class_inheritable_attribte which no longer exists in Rails.

stackoverflow.com

Rack has a limit for how many form parameters it will parse. This limit is 65536 by default.

Lately, I came across a nasty error. I had a class Article that included FooTrait and BarTrait. In BarTrait, I...

makandracards.com

I posted a solution which is awesome and also does natural sorting.

Sometimes you need to remove high Unicode characters from a string, so all characters have a code point between 0...

makandra dev

Ruby 1.9.2 is very slow when loading files, especially starting Rails servers or running specs takes forever.

In a nutshell: Capybara's find will not work properly on nodes from a list. Don't find on elements...

CSS is a lot easier to write and read than clumsy XPath expressions. So when you need to use XPath...

Note that this seems to affect only recent Rails 2 versions. You will not encounter this until you are writing...

Always use simply require 'spec_helper' If you mix it up like require 'spec_helper' require File.dirname(__FILE__) + '/../spec_helper'

Recent rails security updates have shown that people make incorrect assumptions about the possible contents of the params hash.

ActiveSupport >= 3 has Date.parse('2011-02-10').beginning_of_quarter #=> 2011-01-01 Date.parse('2011-02-10').end_of_quarter...

If you're suffering from a huge de.yml or similiar file, cry no more. Rails lets you freely organize your...

Why string sorting sucks in vanilla Ruby Ruby's sort method doesn't work as expected with special characters (like...

makandra dev
github.com

Introspect the Ruby Heap by indexing, counting, locating references to and detaching (in order to release) objects.

If you have a file that looks like a precompilation fingerprint, the Rails asset pipeline will not see it. So...

blog.jcoglan.com

Read the linked article together with this reply to get an appreciation for why it's a bad idea to...

When using the asset pipeline your assets (images, javascripts, stylesheets, fonts) live in folders inside app: app/assets/fonts app/assets/images...

makandra dev
goat1000.com

TagCanvas is a Javascript class which will draw and animate a HTML5 canvas based tag cloud.

The following snippet will convert a string with wildcards to a appropriate regexp, i.e. parse_wildcards("foobar") # => /\Afoo.bar\z/