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