The cookies object in your controllers and views is a ActionController::CookieJar and even though that class inherits from Hash...
Next time you have to do more than trivial CSS changes on a project, you probably want to have live...
Did you know you can do in-place batch processing with plain ruby? The following script will in-place replace...
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...
Set the hash to a dummy hash which doesn't hit any id at your page, for example: window.location.hash = "_";
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...
Coffeescript allows you to create classes whose methods are automatically bound to the correct this. You can do this by...
Merge requests are often rejected for similar reasons. To avoid this, before you send a merge request, please confirm that...
Put the attached files into your home directory and enjoy. .irbrc defines interesting_methods, which is essentially all methods without...
Do it like this: attribute :active, Virtus::Attribute::Boolean Long story In Virtus you define attribute with their type...
Essential backports that enable many of the nice features of Ruby 1.8.7 up to 2.0.0 for earlier versions.
The Ruby on Rails security list archive can be found here: http://groups.google.com/group/rubyonrails-security You can subscribe to this mailing...
As Bill Dueber has on his blog, you can call rvm in the shebang to select a Ruby version like...
You have multiple options: Just don't have a type column. All STI magic will be disabled automatically.
When you need to find out in which kind of spec you are during run-time, it's definitely possible...
Note: These instructions are for a quick per-project setup and may require you to change code. If you generally...
Option 1: Creating a self-signed certificate with the openssl binary As igalic commented on this gist. openssl req -new...
ActiveRecord translations live in locale.activerecord. ActiveModel translations live in locale.activemodel. To use the same translations for both, use YAML references...
Getting a regular expression from a string in JavaScript is quite simple: new RegExp('Hello Universe'); # => /Hello Universe/
Authentication is hard: there are many edge cases, and most users (including yourself) usually only go the "happy path" once...
We have often felt the pain where our models need to serve too many masters. E.g. we are adding a...
In the following example the method update_offices_people_count won't be called when office_id changes, because it...