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

Inherits:
Admin::Components::BaseController
  • Object
show all
Defined in:
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

Instance Method Details

#postObject



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

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

#postsObject



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

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