def input(method, options = {})
options = options.dup
options[:required] = method_required?(method) unless options.key?(:required)
options[:as] ||= default_input_type(method, options)
html_class = [ options[:as], (options[:required] ? :required : :optional) ]
html_class << 'error' if has_errors?(method, options)
wrapper_html = options.delete(:wrapper_html) || {}
wrapper_html[:id] ||= generate_html_id(method)
wrapper_html[:class] = (html_class << wrapper_html[:class]).flatten.compact.join(' ')
if options[:input_html] && options[:input_html][:id]
options[:label_html] ||= {}
options[:label_html][:for] ||= options[:input_html][:id]
end
input_parts = (custom_inline_order[options[:as]] || inline_order).dup
input_parts = input_parts - [:errors, :hints] if options[:as] == :hidden
list_item_content = input_parts.map do |type|
send("inline_#{type}_for""inline_#{type}_for", method, options)
end.compact.join("\n")
return template.content_tag(:li, Formtastic::Util.html_safe(list_item_content), wrapper_html)
end