Sha256: 61b05fe753491cb52afbf8a2a9bcc2f8e7872d5ddce60926d4dad5d0d0102b37
Contents?: true
Size: 1.38 KB
Versions: 1
Compression:
Stored size: 1.38 KB
Contents
module Hancock::Search::Decorators module Search extend ActiveSupport::Concern # def index # return redirect_to url_for(params) if search_redirecter # # if Hancock::Search.config.breadcrumbs_on_rails_support # add_breadcrumb "search", [:hancock_search], if: :insert_breadcrumbs # add_breadcrumb "results", [:hancock_search, {q: params[:q]}], if: :insert_breadcrumbs # end # # if params[:q].blank? # @results = [] # else # @results = search_scope ? search_scope.page(params[:page]).per(per_page).send(fts_method, query) : [] # end # end # # private # def search_model_class # Hancock::Pages::Page if Hancock::Search.config.pages_support # end # # def search_scope # search_model_class.enabled if search_model_class # end # # def fts_method # :fts # end # # def search_redirecter # if params[:utf8].present? or params[:submit].present? or params[:commit].present? # params.delete(:utf8) # params.delete(:submit) # params.delete(:commit) # return true # end # false # end # # def insert_breadcrumbs # true # end # # def per_page # 10 # end # # def query # params[:q].to_s.gsub(/\P{Word}+/, ' ').gsub(/ +/, ' ').strip # end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
hancock_cms_search-1.0.2 | app/controllers/concerns/hancock/search/decorators/search.rb |