| Module | Searchlogic::RailsHelpers |
| In: |
lib/searchlogic/rails_helpers.rb
|
Automatically adds an "order" hidden field in your form to preserve how the data is being ordered.
Automatically makes the form method :get if a Searchlogic::Search and sets the params scope to :search
Creates a link that alternates between acending and descending. It basically alternates between calling 2 named scopes: "ascend_by_*" and "descend_by_*"
By default Searchlogic gives you these named scopes for all of your columns, but if you wanted to create your own, it will work with those too.
Examples:
order @search, :by => :username order @search, :by => :created_at, :as => "Created"
This helper accepts the following options: