Skip to content

Instantly share code, notes, and snippets.

@cedricdekimpe
Created October 24, 2013 09:05
Show Gist options
  • Save cedricdekimpe/7133741 to your computer and use it in GitHub Desktop.
Save cedricdekimpe/7133741 to your computer and use it in GitHub Desktop.
SearchController for LocomotiveCMS
class SearchController < ApplicationController
include Locomotive::Routing::SiteDispatcher
include Locomotive::Render
def index
@page = Locomotive::Page.where(:handle => 'search-results').first
results = Locomotive::ContentEntry.fulltext_search(params[:search])
@drops_results = Liquid::Drops::ResultsDrop.new(results)
render_locomotive_page @page, { "search_results" => @drops_results }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment