Skip to content

Instantly share code, notes, and snippets.

@cknoxrun
Created July 12, 2013 20:33
Show Gist options
  • Save cknoxrun/5987590 to your computer and use it in GitHub Desktop.
Save cknoxrun/5987590 to your computer and use it in GitHub Desktop.
def index
options = params
options[:page] ||= 1
options[:limit] ||= 50
@pathway_visualizations =
PathwayVisualization.search(load: true, page: options[:page],
per_page: options[:limit]) do |search|
if options[:term].present?
search.query do |query|
query.string options[:term]
end
end
search.sort { by :name, 'asc' }
end
respond_with @pathway_visualizations
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment