Skip to content

Instantly share code, notes, and snippets.

<html>
<body>
<h1>For abigail: example options</h1>
<p>My first version.</p>
<a href="http://www.womenscsa.com/Default.aspx?pageId=316002" ><img class="artText" src="http://www.womenscsa.com/Content/ArtText/1/315993/131779-4.png" title="Join Today!" alt="Join Today!" width="194" height="59" style="border:4px outset;padding:2px;text-decoration:none" /></a>
<p>My second version.</p>
def title_tag(title_string)
controller_str = controller.controller_name.capitalize! || 'Home'
action_str = controller.action_name.capitalize || 'Index'
title_string.gsub("%controller%",controller_str).gsub("%action%",action_str)
content_tag(:title,title_string)
end
module ApplicationHelper
# A simple helper counting/calculating business days from_now in ruby on rails
# from a desired time interval (i.e. ten business days from now)
def business_days_from_now(interval=10)
business_days = 0
total_days = 0
while business_days < interval
total_days+=1
# this script will migrate and reorganize a Paperclip attachments directory to utilize :id_partition
# Quickly put together by mario@orbitalvoice.com
# Assumes that your images to migrate < 1 000 000
#
# Usage: ruby paperclip_partition_id_migrate.rb TARGET_DIR=/path/to/attachments/:class/:style
require '/opt/ruby-enterprise/lib/ruby/1.8/fileutils.rb'
def add_leading_zeros(i)