Sha256: 6199f886318f95f9e55bad37bf6473dc2186532c444475967c4becff4e201fe7
Contents?: true
Size: 962 Bytes
Versions: 25
Compression:
Stored size: 962 Bytes
Contents
# frozen_string_literal: true module Decidim module Sortitions # Exposes the sortition resource so users can view them class SortitionsController < Decidim::Sortitions::ApplicationController helper Decidim::WidgetUrlsHelper include FilterResource include Orderable include Paginable helper_method :sortition helper Decidim::Proposals::ApplicationHelper def index @sortitions = search .results .includes(:author) .includes(:category) @sortitions = paginate(@sortitions) @sortitions = reorder(@sortitions) end private def sortition Sortition.find(params[:id]) end def search_klass SortitionSearch end def default_filter_params { search_text: "", category_id: "", state: "active" } end end end end
Version data entries
25 entries across 25 versions & 1 rubygems