From 46f606955555005da695bb04df2cbe68ddb56df8 Mon Sep 17 00:00:00 2001 From: Steve Kenworthy Date: Tue, 6 Jan 2015 12:30:31 +0800 Subject: [PATCH] Fixes #393 - migrate to new simple_form syntax. --- app/inputs/date_pair_input.rb | 4 ++-- app/inputs/date_time_input.rb | 4 ++-- app/inputs/text_input.rb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/inputs/date_pair_input.rb b/app/inputs/date_pair_input.rb index 688f8d9313..a76f803fbc 100644 --- a/app/inputs/date_pair_input.rb +++ b/app/inputs/date_pair_input.rb @@ -7,7 +7,7 @@ class DatePairInput < SimpleForm::Inputs::Base # Output two date fields: start and end #------------------------------------------------------------------------------ - def input + def input(wrapper_options) add_autocomplete! out = "
".html_safe @@ -20,7 +20,7 @@ def input input_html_options.merge!(field.input_options) input_html_options.merge!(value: value(field)) out << "#{label}".html_safe - text = @builder.text_field(field.name, input_html_options) + text = @builder.text_field(field.name, merge_wrapper_options(input_html_options, wrapper_options)) out << text << ''.html_safe end diff --git a/app/inputs/date_time_input.rb b/app/inputs/date_time_input.rb index 398f071ce0..fcf7e049bd 100755 --- a/app/inputs/date_time_input.rb +++ b/app/inputs/date_time_input.rb @@ -5,11 +5,11 @@ #------------------------------------------------------------------------------ class DateTimeInput < SimpleForm::Inputs::DateTimeInput - def input + def input(wrapper_options) add_autocomplete! input_html_options.merge(input_options) input_html_options.merge!(value: value) - @builder.text_field(attribute_name, input_html_options) + @builder.text_field(attribute_name, merge_wrapper_options(input_html_options, wrapper_options)) end def label_target diff --git a/app/inputs/text_input.rb b/app/inputs/text_input.rb index 52b104a487..5541ebbd38 100644 --- a/app/inputs/text_input.rb +++ b/app/inputs/text_input.rb @@ -4,8 +4,8 @@ # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php #------------------------------------------------------------------------------ class TextInput < SimpleForm::Inputs::TextInput - def input - @builder.text_area(attribute_name, {rows: 7}.merge(input_html_options)) + def input(wrapper_options) + @builder.text_area(attribute_name, {rows: 7}.merge(merge_wrapper_options(input_html_options, wrapper_options))) end ActiveSupport.run_load_hooks(:fat_free_crm_text_input, self)