Class: Decidim::Blogs::Admin::ApplicationController

Inherits:
Admin::Components::BaseController show all
Defined in:
decidim-blogs/app/controllers/decidim/blogs/admin/application_controller.rb

Overview

Base controller for the administration of this module. It inherits from Decidim’s admin base controller in order to inherit the layout and other convenience methods relevant to a this component.

Instance Method Summary collapse

Methods inherited from Admin::Components::BaseController

#current_component, #current_participatory_space, #parent_path, #permission_class_chain, #permission_scope, #permissions_context, #set_component_breadcrumb_item, #skip_manage_component_permission

Methods included from RegistersPermissions

register_permissions

Methods inherited from Admin::ApplicationController

#permission_class_chain, #permission_scope, #user_has_no_permission_path, #user_not_authorized_path

Methods included from Headers::HttpCachingDisabler

#disable_http_caching

Methods included from NeedsSnippets

#snippets

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#postObject



16
17
18
# File 'decidim-blogs/app/controllers/decidim/blogs/admin/application_controller.rb', line 16

def post
  @post ||= posts.find(params[:id])
end

#postsObject



12
13
14
# File 'decidim-blogs/app/controllers/decidim/blogs/admin/application_controller.rb', line 12

def posts
  @posts ||= Post.where(component: current_component).page(params[:page]).per(15)
end