Skip to content

Instantly share code, notes, and snippets.

@jlstr
Created November 5, 2012 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlstr/4020422 to your computer and use it in GitHub Desktop.
Save jlstr/4020422 to your computer and use it in GitHub Desktop.
Sorting using Ransack
class LandingController < ApplicationController
layout "landing2"
def index
@zones = Zone.all
@zone_id ||= 1
@q = Property.search(params[:q])
@q.build_sort if @q.sorts.empty?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment