From c8b6ec5204f873c48b4edd1eee222879e75486a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 16 Feb 2012 12:07:46 -0200 Subject: [PATCH] Update the Wrappers API --- lib/simple_form.rb | 4 ++-- test/support/misc_helpers.rb | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/simple_form.rb b/lib/simple_form.rb index 74edfd90..28eb7b38 100644 --- a/lib/simple_form.rb +++ b/lib/simple_form.rb @@ -165,8 +165,8 @@ module SimpleForm b.optional :readonly b.use :label_input - b.use :hint, :tag => :span, :class => :hint - b.use :error, :tag => :span, :class => :error + b.use :hint, :wrap_with => { :tag => :span, :class => :hint } + b.use :error, :wrap_with => { :tag => :span, :class => :error } end ## SETUP diff --git a/test/support/misc_helpers.rb b/test/support/misc_helpers.rb index 3e1de13d..7ab0ab76 100644 --- a/test/support/misc_helpers.rb +++ b/test/support/misc_helpers.rb @@ -35,22 +35,22 @@ module MiscHelpers def custom_wrapper SimpleForm.build :tag => :section, :class => "custom_wrapper", :pattern => false do |b| b.use :pattern - b.use :another, :class => "another_wrapper" do |ba| + b.wrapper :another, :class => "another_wrapper" do |ba| ba.use :label ba.use :input end - b.use :error_wrapper, :tag => :div, :class => "error_wrapper" do |be| - be.use :error, :tag => :span, :class => "omg_error" + b.wrapper :error_wrapper, :tag => :div, :class => "error_wrapper" do |be| + be.use :error, :wrap_with => { :tag => :span, :class => "omg_error" } end - b.use :hint, :tag => :span, :class => "omg_hint" + b.use :hint, :wrap_with => { :tag => :span, :class => "omg_hint" } end end def custom_wrapper_without_top_level SimpleForm.build :tag => false, :class => 'custom_wrapper_without_top_level' do |b| b.use :label_input - b.use :hint, :tag => :span, :class => :hint - b.use :error, :tag => :span, :class => :error + b.use :hint, :wrap_with => { :tag => :span, :class => :hint } + b.use :error, :wrap_with => { :tag => :span, :class => :error } end end