Sha256: 2f47e59dab2e434919e78ad16f44fbcba1c4397bb6b151a7b928d828a973a6ca
Contents?: true
Size: 856 Bytes
Versions: 10
Compression:
Stored size: 856 Bytes
Contents
module Globalize2 module FormBuilderExtensions def self.included(base) base.alias_method_chain :text_field, :globalize base.alias_method_chain :text_area, :globalize end def text_field_with_globalize(method, options = {}) Rails.logger.debug "FormBuilder: text_field_with_globalize" options[:value] = options[:value] || I18n.with_locale(Globalize2Extension.content_locale) { object && object.send(method) } text_field_without_globalize(method, options) end def text_area_with_globalize(method, options = {}) options[:value] = options[:value] || I18n.with_locale(Globalize2Extension.content_locale) { object && object.send(method) } text_area_without_globalize(method, options) end end end ActionView::Helpers::FormBuilder.send(:include, Globalize2::FormBuilderExtensions)
Version data entries
10 entries across 10 versions & 1 rubygems