Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
class PagesController < ApplicationController verify :params => :name, :only => :show, :redirect_to => :root_url before_filter :ensure_valid, :only => :show def show render :template => "pages/#{current_page}" end protected def current_page params[:name].to_s.downcase end def ensure_valid unless template_exists?("pages/#{current_page}.html.erb") render :nothing => true, :status => 404 and return false end end end
This paste will be private.
From the Design Piracy series on my blog: