Public Gists by clemens

Gravatar
Mon Aug 18 06:28:49 -0700 2008
1
2
3
# with :show_sign option and extended :format
def number_to_currency(number, options = {})
  options.symbolize_keys!
Gravatar
Wed Jul 30 15:22:36 -0700 2008
1
2
3
[11:21pm] clemensk: my idea is to pretty much remove the DATE_FORMATS constants and deprecate them
[11:21pm] clemensk: like it has been done with the COUNTRIES in the form options helper
[11:21pm] clemensk: and instead have a DEFAULT_FORMATS constant
Gravatar
Mon Jul 28 15:03:04 -0700 2008
1
2
3
def number_to_human_size(number, *args)
  return number.nil? ? nil : pluralize(number.to_i, "Byte") if number.to_i < 1024
  
Gravatar
Mon Jul 28 09:05:53 -0700 2008
1
2
3
# config
:number => {
  :format => {
Gravatar
Sun Jul 27 22:44:44 -0700 2008
1
2
3
ActionController::Base.logger.info "[Base] Loading config/initializers/" + File.basename(__FILE__)
class String
  def to_permalink
Gravatar
Fri Jul 25 05:40:13 -0700 2008
1
2
3
Object.class_eval do
  def deep_clone
    Marshal::load(Marshal.dump(self))
Gravatar
Tue Jul 22 13:55:26 -0700 2008
1
2
3
class DateTimeSelector
  include TagHelper