Two columns, one stretches with the window the other doesn’t
A little CSS pattern to demonstrate what to do when you want one column to stay at a fixed width…
Ruby 1.8.7 patchlevel inconsistency; “super called outside of method”
I discovered an interesting difference between two patch levels of the same Ruby (1.8.7) def index respond_to do |format| format.html…
I want my @current_user in my model: A Lesson in Abstraction
This method was adapted from this blog post. So, you are creating a thing (record) or maybe you are updating…
How do I get the HTTP referrer?
The referrer is the URL the user came from. (It gets passed as part of the headers to the new…
Public, Private, Protected
Quick demonstration of public, private, and protected methods.
The Interface IS the Experience: Why the iPad Changes the Game
In 1984 the personal computer industry was forever changed by the first Mac. More expensive and less familiar than the…
Three ways to invoke a method in ruby
There are three ways to invoke a method. Most of the time you’ll probably only need #1, but #2 and…
Reading a file in Ruby
Reads a file line by line into an array my_stuff my_stuff = [] file = File.new(“config/random_categories.txt”, “r”) while (line =…
How do I set the rails environment (RAILS_ENV)?
Note that when setting the Rails environment you have to pass it differently in different cases. For rake, set RAILS_ENV=…
Installing Facebooker for Rails
WARNING: These instructions are for Facebook version 1 (not Facebooker2). Since last year, I have moved toward using a different…