Authlogic Account Activation Tutorial

Here’s the original: Here’s my fork on github: Below is the formatted guide that is on github. Remember, all credit goes to Matt Hooks and his original Authlogic Account Activation Tutorial Introduction This is an easier to read version of Matt Hooks’ Authlogic Activation Tutorial. The tutorial is divided into a number of steps and walks through the process of implementing user activation functionality into your pre-existing Rails app using Authlogic.

How To: Setup RSpec, Cucumber, Webrat, RCov and Autotest on Leopard

Prerequisites I’m assuming you’ve got the following installed: ruby ruby gems 1.3.1 Apple development tools git rails >= 2.3.2 You’ve added github to your gem sources (gem sources -a RSpec & RSpec-Rails First let’s grab the rspec1 and rspec-rails2 gems. sudo gem install rspec sudo gem install rspec-rails Cucumber Next we’ll install the cucumber3 gem

RSpec Shared Example Gotcha

Below we have an example model, spec and shared example group. Our Dog model has its own set of functionality, but as a mammal it should still have some aspects of being a mammal. We’ve got some specs in a shared example group that we use for testing all of our mammal models to make sure things don’t get too out of whack in the universe. Our Example Model class Dog attr_accessor :name, :mammal def initialize self.

Why I Switched to Nginx

Here’s why I decided to give Nginx a shot: Nginx is lightweight and has a small memory footprint Nginx is super fast Nginx can be easily configured to send rails requests to mongrel, thin and others Nginx has easy to read configuration logs and rewriting rules I get to learn something new! Note: All ApacheBench test results displayed are the from the 4th consecutive test. This minimizes the negative effects of the slow startup of ruby processes with Phusion Passenger where the initial requests take a considerably long time.

Quit Being Comfortable

If you’re heading towards that dip, or feel like you’ve been stuck there for a while, fear not, it’s easy to shake yourself out of it. Put yourself on the line and increase your expectations. It’s easy to fall into comfortable relationships, comfortable careers, comfortable routines and lead a comfortable lifestyle. However, once you’re in that position you start to wonder where the magic went. You can recall a time when you were excited and things sparked your interest, now, they’re just boring old routines.

PHP Deployment with Capistrano

Assumptions & Requirements There are assumptions that I will be making throughout this article, they include: You are using OS X/Linux You are comfortable using the command line The code for your PHP application resides in some type of source control system The deployment server is running some type of *nix The deployment server is using a LAMP setup You have Ruby and Ruby Gems installed on your system Installing Capistrano I’m using the latest (as of this post) version which is 2.

Paperclip and Amazon S3

I recently added the ability to give each one of my posts a photo. It makes the entire site a bit less boring and gives it some human feel. I found the excellent paperclip plugin from the thoughtbot guys. This allowed me to easily attach pictures, have them resized and display them along side my posts. However, I ran into some problems with managing the upload files, no worries, Amazon S3 to the rescue.

Learning Rails: namespaced controllers

A common requirement of a visitor facing web application is that the administration component of the app is behind a login with a different layout, style sheet and feel. Rails 2.0 makes this very simple with namespaced controllers. On a recent project the specs called for the administration to live under an /admin path, simple enough. script/generate controller admin/employees index show new create edit update Perfect, now I’ve got my new controller and some views.