My Recent Pastes (24 and counting)

Pastes by LeeH (24 and counting)

Pages: 1

Below are the 15 most recent pasties by LeeH.

March 15, 2007
6:28PM EDT
by LeeH

require 'active_record/fixtures'

namespace :db do
  namespace :migrate do
    namespace :defaults do

March 15, 2007
6:28PM EDT
by LeeH

oopse :S

March 07, 2007
7:56AM EDT
by LeeH

CodePress = {
        initialize : function() {
                cpWindow = $('cp-window');
                cpEditor = $('cp-editor');
                cpBody = cpEditor.contentWindow;

February 25, 2007
11:00PM EDT
by LeeH

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
        "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en">
<head>

February 25, 2007
10:43PM EDT
by LeeH

<h1><%= @title.name %></h1>
<table>
    <tr>
        <td valign="top">
            <%= image_tag @title.full_image %>

February 25, 2007
10:41PM EDT
by LeeH

<h1><%= @title.name %></h1>
<table>
    <tr>
        <td valign="top">
            <%= image_tag @title.full_image %>

February 25, 2007
8:53PM EDT
by LeeH

# Ruby knows what you
# mean, even if you
# want to do math on
# an entire Array

February 25, 2007
1:39PM EDT
by LeeH

## From divoxx
## For better authorization

class FooController < ApplicationController
  def edit

February 25, 2007
1:35PM EDT
by LeeH

# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base

February 25, 2007
10:17AM EDT
by LeeH

# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper

  # #
  # Taken From "HowToUseActsAsTree in Ruby"

February 25, 2007
10:14AM EDT
by LeeH

class PopulateTables < ActiveRecord::Migration
  def self.up
  
    # Create Rights (Administrator)  
    Right.create :name => '* All Title Actions', :controller => 'titles'

February 25, 2007
9:49AM EDT
by LeeH

class AddOpenForComments < ActiveRecord::Migration
  def self.up
    Article.find_all.each do |article|
      if article.comments.size == 0
        Comment.new do |comment|

February 25, 2007
9:22AM EDT
by LeeH

def browse
  @current_category = Category.find(params[:id] || :first)
end

February 22, 2007
9:58AM EDT
by LeeH

                                <% @role.rights.each { |right| -%>
                                <option value="<%= right.id %>"><%= (right.controller.empty? ? '*' : right.controller) + '/' + (right.action.empty? ? '*' : right.action) %></option>
                                <% } -%>

February 22, 2007
8:17AM EDT
by LeeH

# the module status:

module Status

  NEW = 'new'

Next page