From e143376f8fd2fecb86ceb695df1a6f801cdeaa03 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Fri, 24 Sep 2010 00:51:57 -0300 Subject: [PATCH] Use placeholders instead of placeholder for I18n, following the conventions --- lib/simple_form/inputs/string_input.rb | 2 +- test/form_builder_test.rb | 2 +- test/inputs_test.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/simple_form/inputs/string_input.rb b/lib/simple_form/inputs/string_input.rb index b296ebbc..b471b558 100644 --- a/lib/simple_form/inputs/string_input.rb +++ b/lib/simple_form/inputs/string_input.rb @@ -29,7 +29,7 @@ module SimpleForm end def placeholder - @placeholder ||= options[:placeholder] || translate(:placeholder) + @placeholder ||= options[:placeholder] || translate(:placeholders) end end end diff --git a/test/form_builder_test.rb b/test/form_builder_test.rb index 46709f98..a5a3a7cf 100644 --- a/test/form_builder_test.rb +++ b/test/form_builder_test.rb @@ -231,7 +231,7 @@ class FormBuilderTest < ActionView::TestCase end test 'placeholder should not be generated when set to false' do - store_translations(:en, :simple_form => { :placeholder => { :user => { + store_translations(:en, :simple_form => { :placeholders => { :user => { :name => 'Name goes here' } } }) do with_form_for @user, :name, :placeholder => false diff --git a/test/inputs_test.rb b/test/inputs_test.rb index 255f6242..9b8420b2 100644 --- a/test/inputs_test.rb +++ b/test/inputs_test.rb @@ -59,7 +59,7 @@ class InputTest < ActionView::TestCase end test 'input should use i18n to translate placeholder text' do - store_translations(:en, :simple_form => { :placeholder => { :user => { + store_translations(:en, :simple_form => { :placeholders => { :user => { :name => 'Name goes here' } } }) do with_input_for @user, :name, :string