Permalink
Browse files

Add locale file.

  • Loading branch information...
1 parent e277bd0 commit 751bc1843e1c438db22f355ef516a4afd57c2c79 @josevalim josevalim committed Apr 10, 2010
Showing with 13 additions and 6 deletions.
  1. +5 −6 lib/action_view/helpers/dynamic_form.rb
  2. +8 −0 lib/action_view/locale/en.yml
@@ -1,4 +1,5 @@
-require 'action_view/helpers/form_helper'
+require 'action_view/helpers'
+require 'active_support/i18n'
require 'active_support/core_ext/enumerable'
require 'active_support/core_ext/object/blank'
@@ -270,10 +271,6 @@ def to_tag(options = {})
end
end
- def error_message
- object.errors[@method_name]
- end
-
def column_type
object.send(:column_for_attribute, @method_name).type
end
@@ -300,4 +297,6 @@ class FormBuilder
include DynamicForm::FormBuilderMethods
end
end
-end
+end
+
+I18n.load_path << File.expand_path("../../locale/en.yml", __FILE__)
@@ -0,0 +1,8 @@
+en:
+ errors:
+ template:
+ header:
+ one: "1 error prohibited this {{model}} from being saved"
+ other: "{{count}} errors prohibited this {{model}} from being saved"
+ # The variable :count is also available
+ body: "There were problems with the following fields:"

0 comments on commit 751bc18

Please sign in to comment.