My Recent Pastes (61 and counting)

Pastes by jhubert (61 and counting)

Pages:

Below are the 15 most recent pasties by jhubert.

May 31, 2008
2:37PM EDT
by jhubert

require 'date'
class Date
  def nth_weekday(nth,day_of_week)
    nth = nth + 1
    last = nth == 6

October 06, 2007
6:10AM EDT
by jhubert

## Default to 'HTML'

# Update the define_url_helper method to append the 'html' format if it's required and not provided
module ActionController
  module Routing

October 02, 2007
4:46PM EDT
by jhubert

        def define_url_helper(route, name, kind, options)
          selector = url_helper_name(name, kind)
          
          # The segment keys used for positional paramters
          segment_keys = route.segments.collect do |segment|

August 31, 2007
8:18PM EDT
by jhubert

## Encoding a value for javascript output

def javascript_encode(value)
  return '' if value.blank?
  string = []

April 06, 2007
8:29PM EDT
by jhubert

## Storing the locale in the URL without having to pass it into resource helpers

Goal:   article_path(@article)  #=>  /en/article/1

## Overriding define_url_helper

March 23, 2007
3:29AM EDT
by jhubert

## Using :unless with validates_presence_of

  # Require the contact details unless the listing uses a central contact
  # This works
!!  validates_presence_of :contact_name, :contact_phone, :contact_email, :if => :do_not_use_central_contact?

March 23, 2007
2:29AM EDT
by jhubert

## try this.  you need to use class instead of id     # vs .     

 .view_lessons { width: 300px; margin-bottom: 5px; }
 .view_lessons h3 { background-color: #999; padding: 5px; color: #fff; }
 .view_lessons ul { background-color: #e7e7e7; border: 1px solid #999; padding-top: 10px; }

March 22, 2007
7:46PM EDT
by jhubert

#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:1848:in `method_missing'
#{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column.rb:107:in `send'
#{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column.rb:107:in `options'
#{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column.rb:113:in `store_dir'
#{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column.rb:349:in `initialize'

March 22, 2007
5:02AM EDT
by jhubert

class Role < ActiveRecord::Base
  has_and_belongs_to_many :permissions
  has_many :users

  validates_presence_of :title 

March 01, 2007
7:39AM EDT
by jhubert

Subject: Expense Report

client: Acme Co
category: Travel
amount: 34.50

March 01, 2007
7:33AM EDT
by jhubert

This is the debug of the basecamp bundle

February 05, 2007
6:16PM EDT
by jhubert

daily
missingok
rotate 6
compress
delaycompress

January 15, 2007
6:10PM EDT
by jhubert

## At the top of the page

<% content_for :head do %>
<style type="text/css" media="screen">
  body { background-image: url(/img/template/campaigns/hnea/bgrd.gif); }

January 13, 2007
3:25PM EDT
by jhubert

[jhubert@kidzworld-ux1 kidzworld]$ sudo gem install railsbench
Password:
Bulk updating Gem source index for: http://gems.rubyforge.org
Install required dependency hoe? [Yn]  y
Install required dependency rubyforge? [Yn]  y

January 10, 2007
5:17AM EDT
by jhubert

# == Description
#
# Section is a descendent of the Kategory class. It is the basis of the Magazine section. Each section contains multiple
# Categories, which hold the content to the site.
#

Next page