Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
class GalleryController < Application before_filter :login_required protected def gallery @gallery ||= current_user.galleries.find(params[:gallery_id]) end helper_method :gallery def load_images gallery.images.paginate(:all, :page => params[:page] end public def index @images = load_images respond_to do |format| format.html format.xml format.iphone end end end ## spec describe GalleryController do it "loads gallery" do @user = mock_model(User, :galleries => mock("association") @user.galleries.should_receive(:paginate) @controller.stub!(:current_user).and_return @user @controller.send :gallery end end
This paste will be private.
From the Design Piracy series on my blog: