Permalink
Browse files

Wrap the hidden searchlogic fields into a <div> container.

XHTML strict doesn't allow <input> fields after <form> without a
surrounding container tag.
  • Loading branch information...
1 parent de6f5b6 commit 7c45ffc4cdde9754354dea0f4babcfd1a121131e @bernd committed Jan 6, 2009
Showing with 8 additions and 7 deletions.
  1. +8 −7 lib/searchlogic/helpers/form.rb
@@ -121,15 +121,16 @@ def insert_searchlogic_fields(args, search_object, search_options, &block)
return unless search_object.is_a?(Search::Base)
name = args.first
options = args.extract_options!
+ html = ""
search_options[:hidden_fields].each do |field|
- html = hidden_field(name, field, :object => search_object, :id => "#{name}_#{field}_#{options.object_id}", :value => (field == :order_by ? searchlogic_base64_value(search_object.order_by) : search_object.send(field)))
+ html << hidden_field(name, field, :object => search_object, :id => "#{name}_#{field}_#{options.object_id}", :value => (field == :order_by ? searchlogic_base64_value(search_object.order_by) : search_object.send(field)))
+ end
- # For edge rails and older version compatibility, passing a binding to concat was deprecated
- begin
- concat(html)
- rescue ArgumentError, NameError
- concat(html, block.binding)
- end
+ # For edge rails and older version compatibility, passing a binding to concat was deprecated
+ begin
+ concat(content_tag(:div, html, :style => 'margin:0;padding:0'))
+ rescue ArgumentError, NameError
+ concat(content_tag(:div, html, :style => 'margin:0;padding:0'), block.binding)
end
args << options
end

0 comments on commit 7c45ffc

Please sign in to comment.