Fix search_form_for fail to assign new :class and :id in options, so now search_form_for works with Bootstrap.

This commit is contained in:
Eric Guo 2012-06-05 22:52:56 +08:00
parent f1da420cd8
commit 6683b85240
1 changed files with 2 additions and 2 deletions

View File

@ -13,8 +13,8 @@ module Ransack
end
options[:html] ||= {}
html_options = {
:class => options[:as] ? "#{options[:as]}_search" : "#{search.klass.to_s.underscore}_search",
:id => options[:as] ? "#{options[:as]}_search" : "#{search.klass.to_s.underscore}_search",
:class => options[:class].present? ? "#{options[:class]}" : "#{search.klass.to_s.underscore}_search",
:id => options[:id].present? ? "#{options[:id]}" : "#{search.klass.to_s.underscore}_search",
:method => :get
}
options[:as] ||= 'q'