My Recent Pastes (53 and counting)

All Pasties (over 53 and counting)

Pages: 1 2 4

Below are summaries of the 8 most recent pasties by Pat Allan.

August 10, 2007
1:31AM EDT
by Pat Allan

1
2
3
4
5
def smart_action(name, object=nil, options={})
    options[:url]    ||= {}
    options[:method] ||= "put"
    options[:label]  ||= ""
    

August 10, 2007
12:16AM EDT
by Pat Allan

1
2
3
4
5
  def action_fieldset(&block)
    @template.concat @template.tag(:fieldset, {:class => "submit"}, true), block.binding
    @template.concat @template.capture(&block), block.binding
    @template.concat "</fieldset>", block.binding
  end

August 10, 2007
12:03AM EDT
by Pat Allan

1
2
3
4
5
    smart_form_for name, object, :url => options[:url],
      :html => {:method => options[:method]}, capture do |f|
      f.action_fieldset capture do
        f.submit options[:label]
      end

August 10, 2007
12:02AM EDT
by Pat Allan

1
2
3
4
5
    smart_form_for name, object, :url => options[:url],
      :html => {:method => options[:method]} do |f|
      f.action_fieldset do
        f.submit options[:label]
      end

August 07, 2007
10:55PM EDT
by Pat Allan

1
2
3
4
5
class ActionController::Caching::Sweeper
  def old_method_to_overwrite(*args)
    # ...
  end
end

August 07, 2007
10:37AM EDT
by Pat Allan

1
2
3
4
5
module Spec
  module Rails
    module DSL
      class EvalContext < Spec::Rails::TestCase
        class << self

July 17, 2007
12:55AM EDT
by Pat Allan

1
2
3
4
5
  def update
    # Order of method is important.
    # 1. Load objects from database
    @customer                   = Customer.find :first, :conditions => {:id => params[:id]}
    @postal_address             = @customer.postal_address

July 17, 2007
12:54AM EDT
by Pat Allan

1
2
3
4
5
  def create
    # Order of method is important
    # 1. Instantiate objects with attributes
    @customer                   = Customer.new params[:customer]
    @postal_address             = Address.new params[:postal_address]

Previous page