Method: Searchlogic::RailsHelpers#fields_for
- Defined in:
- lib/searchlogic/rails_helpers.rb
permalink #fields_for(*args, &block) ⇒ Object
Automatically adds an “order” hidden field in your form to preserve how the data is being ordered.
69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/searchlogic/rails_helpers.rb', line 69 def fields_for(*args, &block) if search_obj = args.find { |arg| arg.is_a?(Searchlogic::Search) } args.unshift(:search) if args.first == search_obj = args. if ![:skip_order_field] concat(content_tag("div", hidden_field_tag("#{args.first}[order]", search_obj.order), :style => "display: inline")) end args << super else super end end |