Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use :input_html for select optional html

Signed-off-by: Justin French <justin@indent.com.au>
  • Loading branch information...
commit e04a8e887e83a8eea5a253ba35ef1c5b377b0b4e 1 parent 6dac04c
@sprsquish sprsquish authored committed
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/formtastic.rb
View
10 lib/formtastic.rb
@@ -372,7 +372,7 @@ def method_required?(attribute, required_option) #:nodoc:
# f.input :author, :value_method => :to_s
# f.input :author, :value_method => :value
#
- # You can pass html_options to the select tag using :html => {}
+ # You can pass html_options to the select tag using :input_html => {}
#
# Examples:
#
@@ -381,15 +381,15 @@ def select_input(method, options)
options[:collection] ||= find_parent_objects_for_column(method)
options[:label_method] ||= detect_label_method(options[:collection])
options[:value_method] ||= :id
- options[:html] ||= {}
+ options[:input_html] ||= {}
if (reflection = find_reflection(method)) && reflection.macro != :belongs_to
- options[:html][:multiple] ||= true
- options[:html][:size] ||= 5
+ options[:input_html][:multiple] ||= true
+ options[:input_html][:size] ||= 5
end
input_name = generate_association_input_name(method)
- html_options = options.delete(:html)
+ html_options = options.delete(:input_html)
choices = formatted_collection(options[:collection], options[:label_method], options[:value_method])
input_label(input_name, options) + template.select(@object_name, input_name, choices, set_options(options), html_options)
end
Please sign in to comment.
Something went wrong with that request. Please try again.