Posted By

brettarogers on 12/11/07


Tagged

textmate rails attributes model activerecord


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

smurf
webstic


Humanized Attributes


 / Published in: Rails
 

  1. class User < ActiveRecord::Base
  2. HUMANIZED_ATTRIBUTES = {
  3. :email => "E-mail address"
  4. }
  5.  
  6. def self.human_attribute_name(attr)
  7. HUMANIZED_ATTRIBUTES[attr.to_sym] || super
  8. end
  9.  
  10. end

Report this snippet  

You need to login to post a comment.