Class: Cms::BlogPostsController

Inherits:
ContentBlockController
  • Object
show all
Defined in:
app/controllers/cms/blog_posts_controller.rb

Instance Method Summary collapse

Instance Method Details

#build_blockObject



4
5
6
7
8
# File 'app/controllers/cms/blog_posts_controller.rb', line 4

def build_block
  super
  ensure_blog_editable
  @block.author = current_user
end

#load_blockObject



10
11
12
13
# File 'app/controllers/cms/blog_posts_controller.rb', line 10

def load_block
  super
  ensure_blog_editable
end

#load_blocksObject



15
16
17
18
# File 'app/controllers/cms/blog_posts_controller.rb', line 15

def load_blocks
  super
  @blocks.delete_if { |b| !b.editable_by?(current_user) }
end