lib/globalize2/form_builder_extensions.rb in radiant-globalize2-extension-0.2.1 vs lib/globalize2/form_builder_extensions.rb in radiant-globalize2-extension-0.2.2

- old
+ new

@@ -5,15 +5,15 @@ 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.send(method) } + 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.send(method) } + options[:value] = options[:value] || I18n.with_locale(Globalize2Extension.content_locale) { object && object.send(method) } text_area_without_globalize(method, options) end end end \ No newline at end of file