How often do you see this?

From University of Maryland's parking web site:

Optimized for IE 6?? HAHA

Comments [0]

Testing Exception Notification in development

Exception Notification is a great Rails plugin that sends you emails whenever a user encounters an error in your application.  It's very customizable, allowing you to configure who receives the email and what content to put into the email.  It works without much setup at all.  When you want to test it out in development mode, just add the following line to your application_controller.rb

# Uncomment to test Exception Notification in dev mode
# alias :rescue_action_locally :rescue_action_in_public 

Exception Notification works by using rescue_action_in_public to capture exceptions that occur when the request is not local.  By adding this alias, we can use the same behavior for local requests.

Comments [0]

Rails 2.3 authentication comparison - Momoro Machine

There are several new, but viable, auth plugins. I’ve used all of them in larger apps, but here is a quick comparison of how they work in the first 5 minutes.

I created a rails 2.3 app that was just a scaffold of products. The goal was simply to have a signup page and a login page. For auth, the products page requires login.

I setup the plugin using the docs on github, or whatever tutorial they linked to.

I’ve included the total app lines of code, plus a subjective measure of the ease of use for each plugin. I realize that lines of code is subjective as well, since I just followed the instructions, and there are perhaps places where I could cut stuff. However, the idea is to just give an idea of what it is like for each plugin if you simply follow the directions that they give.

I also haven’t tried to test any of this stuff, nor have I done anything complex with auth, so it’s possible that some of the plugins didn’t get a chance to shine. I will include more complex stuff in a later post.

Trend

The main trend, as you can see from the lines of code below, is to greatly reduce the impact that auth has on your app. Restful auth creates a ton of code, while all of the newer plugins mostly let you include just one line in your model, and then inherit or include stuff in your controllers as well.

This can be a drawback in that if the plugin’s code isn’t well documented, you often end up having to look in the source. This is because the code is sitting in the plugin/gem, rather than in your app. This is usually fine, though, since it’s ruby. However it can be a pain.

Overview

You can checkout the app I made on github. Each plugin has its own branch.

Again, lines of code is the total number of lines that my app ended up being when using the plugin, not the total number of lines that the plugin itself is, which I didn’t check.

Clearance
Lines of code: 120
Ease of setup: 7
Confusion: 4
Notes:
Clearance generates application.rb, which is no longer used in rails 2.3, so you will have to remove it.
Clearance comes with password reset stuff already setup.
Clearance comes with the best views of any of the plugins here.
Clearance requires looking in the source, it seems.
Clearance automatically does requred e-mail verification, it was not immediatly obvious how to not do that using options.

Simplest Auth
Lines of code: 115
Ease of setup: 8
Confusion: 2
Notes:
Is indeed very simple to setup.
Simplest Auth required 0 thought from me to setup. Was v. fast.

Authlogic
Lines of code: 166
Ease of setup: 9
Confusion: 2
Notes:
The tutorial linked to from the readme for Authlogic makes setup take a .5 – 2 minutes total.
The documentation is good, and does a good job of explaining customization options.
There are a lot of lines of code here b/c the tutorial recommends adding a lot of controller methods to application_controller.rb

Restful Authentication
Lines of code: 280
Ease of setup 8
Confusion: 3
Notes:
Restful Authentication is nice b/c it’s been around so long, which means that it’s well tested / used.
However, the amount of code that it sticks in your app is a bit of a pain.

Conclusion so far

Authlogic is probably the best option of the 4 surveyed here. It provides good, clear customization, while at the same time adding v. few lines of code to maintain.

A nice comparison of the authentication solutions available in Rails. I have tried out Clearance, made by the guys at thoughtbot and thought it was very simple easy to use. I will give Authlogic a try. I like that these newer plugins keep their code in the vendor directory and don't get mixed up with your own.

Comments [0]

Where The Phở status

I was in a good groove working on wherethepho.com back in April and May.  Then summer came along and June and July was totally consumed by my 2 weddings and honeymoon.  Not that I'm complaining... the weddings were fun (and tiring) and my wife and I had an amazing time during our 2 weeks in Europe.

Now I'm back and I've been steadily working on the site again the past 2 weeks, picking up where I left off.  I'm doing an overhaul of the UI, adding more restaurants to the database (currently at 1200), and adding more of the features that I had planned.  The plan is to launch the first version of the site early Winter.  Then release a version with business accounts (hey, gotta bring in some money somehow).  If you haven't already, sign up at http://wherethepho.com to get notified of our release!

Comments [0]

Rails Rumble '09

Just signed up as a judge for Rails Rumble '09.  Can't wait to see what people can put out in the next 48 hours!

http://r09.railsrumble.com/

Comments [0]

Upcoming Tech Events

Spring and good weather is upon us, and there are some great events coming up in the DC/MD/VA area that I'm looking forward to attending. The first is the Bootstrap Maryland Conference on May 2nd.  The conference aims to teach budding entrepreneurs "the necessary tools for running a lean and successful technology business."  Some great local speakers have signed up.  Learn more at http://bootstrapmaryland.com.
The second event I'm looking forward to is RubyNation on June 12 and June 13.  I went to the first one last year and it was good, but this year's speaker lineup is hands down better.  Some of the bigger names in the Ruby community will be there, including David A. Black, Yehuda Katz, Bruce Tate, Chad Fowler, Hal Fulton and Russ Olsen.  I'm especially looking forward to Yehuda's talk on Rails 3.  Learn more at http://rubynation.org.

Comments [0]

Useful Shortcuts in Firefox

Here's a couple of useful keyboard shortcuts for Firefox on the Mac: Command+L = go to the address bar Command + K = go to the Google search box I probably should have known that already but just realized it today.  I'm sure you can do the same in Windows Firefox.  In Safari Command+L works but Command+K doesn't seem to do anything.

Comments [0]

Economy brings down ServiceBeacon

I've seen a lot of articles and talks about how this is a good time to start a business.  I definitely agree, and people should take advantage of the recession however they can.  But as a reality check, in this economy a good idea and good execution sometimes isn't enough.  No matter what the economy is like, sometimes the stars just have to align. Case in point: ServiceBeacon is shutting down. I'm a registered user, and here's an email they sent me today: "We, at ServiceBeacon, are saddened to inform you that our service will be going offline permanently as of April 30, 2009. The current economic turmoil has affected all of us and ServiceBeacon is not immune. Due to staffing shortages and loss of funding, ServiceBeacon can not provide the level of quality expected by you and by us. We have secured sufficient funding to ensure the service will be available until April 30, 2009 so you can extract your service tickets and any odometer or fuel entries. Thank you for your commitment to the service and we wish you all the best in the future. The ServiceBeacon Team" Sad to see them go but hopefully they've got a strong team that will learn from their mistakes and have more success in their next venture. Like Robert Kiyosaki says in his Rich Dad books, when starting a business venture you will most likely fail 9 out of 10 times. What does that mean? You need to be prepared to try 10 times.

Comments [0]

Recommended Rails book

Reading this right now. It's the best of the intro books I've read and covers a lot of new material.

Sent from my iPhone

Comments [0]

Time Machine doesn't restore sendmail settings?

I reinstalled Leopard a few months ago and restored my previous system using Time Machine.  Everything has gone smoothly until today when I encountered a strange error when sending email using a Rails application.  The application uses sendmail when it is in development mode.  Here is the error: sendmail: fatal: chdir /private/var/spool/postfix: No such file or directory A quick google search found the solution.  All you have to do is run the following command: 'sudo /etc/postfix/post-install create-missing' and then restart I got the solution from this discussion on the Apple forums: http://discussions.apple.com/thread.jspa?threadID=1452977&tstart=270

Comments [0]

About

I'm a Ruby on Rails web developer in the D.C. / Northern Virginia area.