app = App.new do
get do
"hi"
...
Ruby On Very Simple Rack framework
by Dan Kubb,
September 14, 2008 18:48
def self.valid?(key) return false unless h = find_by_key(key) h.invitation_details_count < h.total ...
def create subscribers = [] params[:recipients].to_s.each_line do |line| ...
Ruby On Importing large collection ...
by Dan Kubb,
March 22, 2008 21:31
Here is how I would write t...
def squarebutton(name, options = {}, html_options = {})
html_options[:class] = [ html_options[:class], 'squarebutton' ].compact * ' '
link_to content_tag(:span, name), options, html_options
...
Ruby On Adding default html option ...
by Dan Kubb,
February 29, 2008 17:17
This will add the "squarebu...
before_save :titlecase_fields def titlecase_fields ...
Ruby On ActiveRecord Attributes rej...
by Dan Kubb,
February 28, 2008 18:22
This iterates over just the...
[ :planned, :actual ].each do |type|
define_method("#{type}_percent_complete") do
return 0 if send("#{type}_complete_in_dollars").nil?
...
Ruby On Same methods, different Act...
by Dan Kubb,
January 08, 2008 20:06
Here's an alternate approac...

What about being able to ne...