Entries Tagged as 'How-To'

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 [...]

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 [...]