Skip to content

Instantly share code, notes, and snippets.

@scottswezey
Created July 27, 2010 06:10
Show Gist options
  • Save scottswezey/491826 to your computer and use it in GitHub Desktop.
Save scottswezey/491826 to your computer and use it in GitHub Desktop.
module ResultsHelper
def make_table_row_for(result, rate)
ret << []
ret << content_tag(:tr) do
content_tag(:th, rate.to_s.humanize)
content_tag(:td) do
pretty_number_to_currency method(rate, [:mean, :mathematical_mode, :lowest, :highest])
end
end
return ret.join("\n")
end
def method(rate, methods)
methods.each do |method|
@result.send(rate).send(method)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment