class Post < ActiveRecord::Base def to_param self.title.downcase.gsub(/\s+/, "-") end end