Blog / Random thoughts and musings.

Blog Bifurcation
  • on January 31, 2010 -
  • computing
  • |
  • Comments Off on Blog Bifurcation

Blog Bifurcation

Originally this blog started out as a fairly personal journal, but has recently adopted a more technology-oriented theme. I plan to focus even more on technology blogging in the future, but I also want to occasionally blog about personal happenings, so I’ve decided to split my blog in two.

This site, mfischer.com, will return to its roots as the personal blog about Mike Fischer. To publish my technology articles I’ve created a new blog under a new domain: thelastpixel.net. I’ve just gotten started with it, but plan to post regularly on software development and other technology issues. If you’re interested, check it out and sign up for the RSS subscription! If not, just keep watching here for more non-technical news from my life…

the-last-pixel

 

  • on October 10, 2009 -
  • cancer
  • |
  • Comments Off on Pet scan #8

Pet scan #8

I’ve become such a bad blogger: months between updates, and forgetting to mention things like my semi-annual PET scans. After all, cancer is what prompted me to start this blog in the first place, almost exactly three years ago!

Well, in August I had my scan, and as usual, everything turned out fine. Next scan in January. Happy to say that the last two and a half years have probably been my healthiest of the last 20!

 

  • on July 13, 2009 -
  • computing
  • |
  • Comments Off on Essential Ruby on Rails plug-ins and gems

Essential Ruby on Rails plug-ins and gems

Now that I’ve been using Rails for a while, I’ve accumulated a few gems and plugins that I end up using over and over, so I thought I’d share a little about each.

haml and sass

I was sold on Sass from the first few minutes I used it. Sass lets you write CSS using a simplified abstraction format, and compiles your sass code into CSS. Best of all, it can be used without Rails (or Ruby), so I’ve been using it with static web pages as well. Here’s an excellent example from the sass web site:

haml-sass

Haml does the same for HTML. It took me a little longer to get used to, probably because it’s actually a replacement for HTML and Embedded Ruby (ERB). Haml really cuts down on the amount of typing needed to generate HTML, auto-closes tags (based on indentation), and makes it far easier to see the structure of your document. This snapshot from the haml page is a great demonstration:

haml

friendly_id

This extends Rails’ RESTful resources by making URLs look “friendlier”, using a user-specified attribute of a model instead of the auto-generated numeric ID. In other words, by simply adding a statement like has_friendly_id :name to a users model, friendly_id converts URLs from http://my.site.com/users/17 into the much nicer http://my.site.com/users/mike.

Authlogic

This is the leading user authentication framework for Rails. It you need to allow users to register, sign in, change passwords, use OpenID, user LDAP, etc., this is the plug-in for you. It takes some time to learn how to integrate it, since each web site’s implementation is going to be a little different.

mislav-will_paginate

This makes it dead simple to take a model with many records, and display it in pages, where you can control how many are displayed per page, and the style of the page links:

pagination

thoughtbot-paperclip

I’ve researched and tried many file upload/attachment gems but Paperclip is the one I settled on. It seems to be the most actively maintained, and one of the most flexible. File uploading is still not as easy as it should be, especially if you want to provide feedback during upload (usually via a Flash plugin) or allow multiple attachments to a model (usually with an associated polymorphic upload model). Paperclip doesn’t do these things out of the box, but it’s possible to wrangle it into submission…

unobtrusive_date_picker

These days there’s no reason to make your users select a month, day, and year from three separate drop-down boxes, or type a date in some pre-determined format. This plug-in automagically adds a pop-up calendar to your date selection input fields.

date-picker

jRails

When I started learning Javascript a few years ago, it was a huge pain in the neck. I quickly came across Prototype, which made my life much easier. Before I got too far along with that however, I found jQuery and fell instantly in love. This was clearly the way Javascript programming was meant to be. I used it for everything. Then last year when I started learning Rails, I was a little disappointed to find that the javascript library built-in to Rails was Prototype. Fortunately, others apparently had the same complaint, and created JRails, which integrates jQuery with Rails.

Others

There are a few other gems and plugins I use, but not as frequently. They include: Maruku, acts_as_audited, mechanize, and hpricot.

Am I missing out on any must-have gems or plug-ins? Let me know in the comments!