Sha256: 7a76820a1000258d9fbcb979ee034e785fa0ae0422daec66b2d2389b79be27c8
Contents?: true
Size: 756 Bytes
Versions: 13
Compression:
Stored size: 756 Bytes
Contents
# frozen_string_literal: true module Decidim class SearchesController < Decidim::ApplicationController include Rectify::ControllerHelpers include FormFactory include FilterResource include Paginable helper Decidim::FiltersHelper helper_method :term def index Search.call(term, current_organization, filters) do on(:ok) do |results| expose(results: results.page(params[:page]).per(params[:per_page])) end end end private def default_filter_params { term: params[:term], resource_type: nil, decidim_scope_id: nil } end def term @term ||= filter_params[:term] end def filters filter_params end end end
Version data entries
13 entries across 13 versions & 1 rubygems