Humanized Attributes


/ Published in: Rails
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.