Small refactor: add `raw_input` method to make testing custom inputs easier #850

wants to merge 1 commit into
Jump to file or symbol
Failed to load files and symbols.
+7 −3
Diff settings


Just for now

@@ -232,16 +232,20 @@ module InputHelper
# @todo Many many more examples. Some of the detail probably needs to be pushed out to the relevant methods too.
# @todo More i18n examples.
def input(method, options = {})
+ raw_input(method, options).to_html
+ end
+ protected
+ def raw_input(method, options = {})
options = options.dup # Allow options to be shared without being tainted by Formtastic
options[:as] ||= default_input_type(method, options)
klass = input_class(options[:as])
-, template, @object, @object_name, method, options).to_html
+, template, @object, @object_name, method, options)
- protected
# First try if we can detect special things like :file. With CarrierWave the method does have
# an underlying column so we don't want :string to get selected.