Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

option to skip the automatic adding of the order field

  • Loading branch information...
commit 1ea4051c5a67bb7e51696b8805fe53b08b4efdbf 1 parent 89b7877
@binarylogic authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/searchlogic/rails_helpers.rb
View
6 lib/searchlogic/rails_helpers.rb
@@ -69,7 +69,11 @@ def form_for(*args, &block)
def fields_for(*args, &block)
if search_obj = args.find { |arg| arg.is_a?(Searchlogic::Search) }
args.unshift(:search) if args.first == search_obj
- concat(content_tag("div", hidden_field_tag("#{args.first}[order]", search_obj.order)))
+ options = args.extract_options!
+ if !options[:skip_order_field]
+ concat(content_tag("div", hidden_field_tag("#{args.first}[order]", search_obj.order)))
+ end
+ args << options
super
else
super
Please sign in to comment.
Something went wrong with that request. Please try again.