you are in: codestackercodes [RSS]i18n in labels

i18n in labels Delicious Email

rails 2.3.4 doen’t have i18n support in labels
http://lawrencesong.net/2009/04/i18n-label-in-rails-monkey-patch/

show/hide lines
   1  module ActionView 
   2    module Helpers 
   3      class InstanceTag 
   4        def to_label_tag_with_i18n(text = nil, options = {}) 
   5          text ||= object.class.human_attribute_name(method_name) if object.class.respond_to?(:human_attribute_name) 
   6   
   7          to_label_tag_without_i18n(text, options) 
   8        end 
   9   
  10        alias_method_chain :to_label_tag, :i18n 
  11      end 
  12    end 
  13  end
created by leozera — 22 November 2009 — get a short url — tags: helper rails ruby embed

Comments



We dont send spam :)

If checked, it's highlights your comment
simple_captcha.jpg
Are you a human? Type the code from the image