Class: Decidim::Design::Components::CardsController

Inherits:
ApplicationController show all
Includes:
ControllerHelpers, FilterResource, Paginable
Defined in:
decidim-design/app/controllers/decidim/design/components/cards_controller.rb

Constant Summary

Constants included from Paginable

Paginable::OPTIONS

Instance Method Summary collapse

Methods included from ControllerHelpers

#expose, included, #present, #presenter

Methods inherited from ApplicationController

#path_items

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#indexObject



15
16
17
18
19
20
21
# File 'decidim-design/app/controllers/decidim/design/components/cards_controller.rb', line 15

def index
  Search.call("", current_organization, filters, page_params) do
    on(:ok) do |results|
      expose(sections: results.transform_values { |v| v[:results].first(4) })
    end
  end
end