Class: Decidim::Assemblies::AssembliesController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- Decidim::ApplicationController
- ApplicationController
- Decidim::Assemblies::AssembliesController
- Includes:
- AssemblyBreadcrumb, FilterResource, HasParticipatorySpaceContentBlocks, Paginable, ParticipatorySpaceContext
- Defined in:
- decidim-assemblies/app/controllers/decidim/assemblies/assemblies_controller.rb
Overview
A controller that holds the logic to show Assemblies in a public layout.
Constant Summary
Constants included from Paginable
Instance Method Summary collapse
Methods included from RegistersPermissions
Methods inherited from Decidim::ApplicationController
Methods included from UserBlockedChecker
#check_user_block_status, #check_user_not_blocked
Methods included from NeedsSnippets
Methods included from Headers::HttpCachingDisabler
Methods included from HasStoredPath
#skip_store_location?, #store_current_location
Methods included from TranslatableAttributes
Methods included from NeedsOrganization
enhance_controller, extended, included
Instance Method Details
#index ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'decidim-assemblies/app/controllers/decidim/assemblies/assemblies_controller.rb', line 15 def index :list, :assembly respond_to do |format| format.html do raise ActionController::RoutingError, "Not Found" if published_assemblies.none? render "index" end format.js do raise ActionController::RoutingError, "Not Found" if published_assemblies.none? render "index" end format.json do render json: published_assemblies.query.includes(:children).where(parent: nil).collect { |assembly| { name: assembly.title[I18n.locale.to_s], children: assembly.children.collect do |child| { name: child.title[I18n.locale.to_s], children: child.children.collect { |child_of_child| { name: child_of_child.title[I18n.locale.to_s] } } } end } } end end end |
#show ⇒ Object
47 48 49 |
# File 'decidim-assemblies/app/controllers/decidim/assemblies/assemblies_controller.rb', line 47 def show :read, :assembly, assembly: current_participatory_space end |