1 2 3 4
class Object def try_or_zero(method) self.nil? ? 0 : send(method) ...
Ruby On Simple model methods to ret...
by rpheath,
March 06, 2008 18:30
Jeremy Weiskotten - Yeah, I...
1 2 3 4
def self.get_budgeted_hours(charge, rollup) find_by_charge_id_and_rollup_id(charge, rollup).budgeted_hours || 0 end ...
Ruby On Simple model methods to ret...
by rpheath,
March 05, 2008 18:29
Since you're in a class met...
1 2 3
class Service < ActiveRecord::Base ...
Ruby On A to Z only linking to lett...
by rpheath,
January 14, 2008 16:44
Well, not a major refactori...
1 2 3
class User < ActiveRecord::Base ...
Ruby On Refactor my favorite action.
by rpheath,
December 13, 2007 05:18
Here's a stab at it. I'm a ...
1 2 3 4
def place_radio_button_row(options={}) returning html = "<tr>" do html << "<td>#{options[:caption]}</td><td></td>" ...
Ruby On Iterated printing in the he...
by rpheath,
November 18, 2007 04:59
I don't believe you need to...
1 2 3 4
msg = "I wonder if this code can be better." key = "s7eOhg2fqgPRWXtp303B67551G5zpEyHe78q5NR5eWKP9eq9fk54D23" ...
1 2 3 4
module ModelHelpers def self.included(base) ...
Ruby textilize model helper
OK, so I just realized ther...
1 2 3
<%= f.text_field :first_name, :size => 15 %> <%= f.text_field :last_name, :size => 15 %> ...
Ruby On Three groups, three bits of...
by rpheath,
October 26, 2007 22:33
You could probably also do ...
1 2 3
<% yardage_rows do |color| %> <tr> ...
Ruby On Using partials for a golf s...
by rpheath,
October 24, 2007 22:13
Thanks, I ended up using a ...
1 2 3
def new @course = Course.new ...
Ruby Using partials for a golf s...
by rpheath,
October 24, 2007 05:21,
2 refactorings
I'm building a golf applica...

I agree with Ryan B...