Entries Tagged as 'Development'

Tuesday, July 15th, 2008

Pass Blocks to Your Markdown Helper

For the new site, I’m going to be using Markdown to handle the formatting of all of my content. I created a simple helper to make things easy:

def markdown(str) RDiscount.new(str).to_html end

(Note: I’m using the RDiscount library instead of BlueCloth, for reasons discussed here)

However, what if I wanted to add a “Read more” link at [...]

Tuesday, June 24th, 2008

Organize Nested Resource Controllers More Efficiently in Rails

Nested resources are awesome. If you want to have a blog with entries that have comments, the resources are dead simple:

map.resources :entries do |entry| entry.resources :comments end

Awesome, now you have set up paths like entries/3/ and entries/3/comments/ using an EntriesController and a CommentsController. What if, however, you want to have a base comments [...]

Tuesday, June 17th, 2008

Firefox 3 and Firebug

Problem: Firefox 3 (which was released today) does not work with Firebug. Firebug’s website is down.

Solution: I found a developer build of Firebug here that seems to work pretty well. Hopefully the actual developers of Firebug can get their site up soon, but in the meantime, this seems to be working pretty well.

So [...]

Saturday, June 14th, 2008

Follow Euro 2008 on Twitter

After my friend Paul asked me to text him updates from a Euro 2008 game while he was at work, I came up with the idea to set up a twitter bot that posted updates from Soccernet’s gamecasts. After a couple hours of work, using Hpricot and the Twitter gem, I was able to [...]

Saturday, June 7th, 2008

Advanced Rails Recipes

A couple weeks ago, I received my copy of Advanced Rails Recipes by Mike Clark (and others), and so far, I’ve really been enjoying it. The first book by Chad Fowler was easily my favorite Rails book at the time, and the new edition has definitely continued the trend. I’ve always learned best [...]

Saturday, May 17th, 2008

Deploying Rails on Dreamhost with Phusion Passenger

Deploying Ruby on Rails has always been a pain, even with tools like Mongrel and Capistrano. On shared hosting, it’s nearly impossible. A little while ago, I noticed a project called Phusion Passenger (aka mod_rails), which sought to make deploying as easy as uploading your application to your webhost. A few [...]

Tuesday, April 15th, 2008

Cleaning Up User Submitted Data

A little while back, I complained about WordPress’ handling of URLs without “http://”. While it turns out WP actually handles these correctly, it brings up the question on how to handle a user’s inputted data. It’s always important to format or sanitize incoming data, and for items like URLs, which have a well-defined [...]

Tuesday, April 8th, 2008

Clean Up Your Code By Overwriting Methods

Just wanted to share a quick Rails tip that has come in useful for me in the past. Let’s say you’re creating a forum, and when users register, they create a username (like “kyleslat”). However, they can edit their profile and add their full name (like “Kyle Slattery”). They also can decide [...]

Sunday, April 6th, 2008

A Review of CakePHP

Recently, on a somewhat secret project, I’ve had the opportunity to try out CakePHP, an MVC framework for PHP. I wanted to take some time to share my thoughts on what I’ve liked and disliked in my experience so far.

Missing Migrations

My #1 favorite feature in Rails has to be migrations. They allow [...]