Ruby On ActiveRecord: named_scope f...

by rpheath, July 01, 2008 00:00

I agree with Ryan B...

E635ccff7389d9070f5e7e9fe8b36beb Talk
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...

E635ccff7389d9070f5e7e9fe8b36beb Talk
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 Star_full

Since you're in a class met...

E635ccff7389d9070f5e7e9fe8b36beb Talk

Ruby On last_number_of_months

by rpheath, January 20, 2008 21:14

Hmm... that's odd. I've nev...

E635ccff7389d9070f5e7e9fe8b36beb Talk
1
2
3
# you can open up the FixNum class and
# add this method there (optional approach)
...

Ruby On last_number_of_months

by rpheath, January 20, 2008 18:02

There are a couple of thing...

E635ccff7389d9070f5e7e9fe8b36beb Talk
1
2
3
class Service < ActiveRecord::Base
...

Ruby On A to Z only linking to lett...

by rpheath, January 14, 2008 16:44 Star_fullStar_fullStar_full

Well, not a major refactori...

E635ccff7389d9070f5e7e9fe8b36beb Talk
1
2
3
class User
  has_many :messages do
...

Ruby On Rails has_many count

by rpheath, January 11, 2008 19:25 Star_fullStar_fullStar_fullStar_fullStar_full

This is the perfect opportu...

E635ccff7389d9070f5e7e9fe8b36beb Talk
1
2
3
class User < ActiveRecord::Base
  
...

Ruby On Refactor my favorite action.

by rpheath, December 13, 2007 05:18 Star_fullStar_fullStar_fullStar_fullStar_full

Here's a stab at it. I'm a ...

E635ccff7389d9070f5e7e9fe8b36beb Talk
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...

E635ccff7389d9070f5e7e9fe8b36beb Talk
1
2
3
4
msg = "I wonder if this code can be better."
key = "s7eOhg2fqgPRWXtp303B67551G5zpEyHe78q5NR5eWKP9eq9fk54D23"

...

Ruby On Circular Cipher

by rpheath, November 06, 2007 23:16 Star_fullStar_full

Maybe I'm not thinking clea...

E635ccff7389d9070f5e7e9fe8b36beb Talk

Ruby On textilize model helper

by rpheath, November 02, 2007 03:32

Yeah, just realized that......

E635ccff7389d9070f5e7e9fe8b36beb Talk
1
2
3
4
module ModelHelpers

  def self.included(base)
...

Ruby textilize model helper

by rpheath, November 02, 2007 03:01, 2 refactorings, tagged with ruby, textile, rails, filter

OK, so I just realized ther...

E635ccff7389d9070f5e7e9fe8b36beb Talk
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 Star_fullStar_fullStar_fullStar_full

You could probably also do ...

E635ccff7389d9070f5e7e9fe8b36beb Talk
1
@text = ERB.new(params[:textarea_body]).result(binding)

Ruby On Need explaination

by rpheath, October 25, 2007 02:36

So if I wanted to build an ...

E635ccff7389d9070f5e7e9fe8b36beb Talk
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 ...

E635ccff7389d9070f5e7e9fe8b36beb Talk
1
2
3
<% @post.images.each do |image| %>
  <%= check_box_tag "image_ids[]", image.id -%>
...

Ruby On attachment_fu integration

by rpheath, October 24, 2007 21:49 Star_fullStar_fullStar_fullStar_full

I'm not completely sure I g...

E635ccff7389d9070f5e7e9fe8b36beb Talk
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...

E635ccff7389d9070f5e7e9fe8b36beb Talk