Simply give the select helper an option :disabled, passing either a single value or an array. You need to specify...

jimneath.org

The linked page lists and explains global Ruby "dollar" variables, such as: $: (load path) $* (ARGV) $? (Last exit status) $$ (PID)

Ruby 1.9 brings a shorter way to define lambdas using the -> operator: twice = -> (x) { 2 * x } twice.call(5) # => 10

Connect to your memcached host. (AWS elasticache is memcached) telnet foohost23.cs2631.0001.euw1.cache.amazonaws.com 11211 Once you're connected, find out which 'slabs...

1. Saving files to a directory that is not shared between deploys or servers If you save your uploads to...

This card shows how to upgrade a Rails 2 application from Rails 2.3.8 through every single patch level up to...

The Rails secret_token must be unique for each application and any instance of it. If not, someone could exploit...

Our development process makes us deploy very often. As the number of releases grows, junk clogs up the hard drive...

When you need to find out in which kind of spec you are during run-time, it's definitely possible...

makandra dev

git shortlog -s -n [commit-range] -n, --numbered Sort output according to the number of commits per author

Option 1: Creating a self-signed certificate with the openssl binary As igalic commented on this gist. openssl req -new...

This trick might be useful to implement more complicated directives in AngularJS. I needed it to do drag'n'drop...

Rails gives you migrations to change your database schema with simple commands like add_column or update. Unfortunately these commands...

Caution when using .where to exclude records from a scope like this: # Fragile - avoid User.where("id NOT IN (?)", excluded_ids...

In specs, the session never persists but is always a new object for each request. Data put into the session...

Find out in this short guide, how to horizontally center a absolute positioned container with CSS. Note: We have a...

view_context.helper_method('args') Rails 2 ApplicationController.helpers.helper_method('args') Also see How to use helper methods inside a model...

The way Rational#to_s works on Ruby has changed from Ruby 1.9 on. Here is how to get the...

Unfortunately, Capybara does not offer a switch to disable cookies in your test browser. However, you can work around that...

Rails flashes (FlashHash) track a list of used keys, which is not respected when comparing flash hashes.

ariejan.net

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

makandra dev

Sometimes it seems a favicon does not work because your browser displays an old version or (in case of local...

calc() lets you mix CSS units. Ever wanted to give an element "the container's width minus 20px on each...

tl;dr: Do not use merge! for session hashes. Use update instead. Outline Let's assume you're modifying the...