Class: FrontEnd::BlogsController

Inherits:
MainApplicationController
  • Object
show all
Includes:
C::BlogsHelper
Defined in:
app/controllers/c/front_end/blogs_controller.rb

Instance Method Summary collapse

Methods included from C::BlogsHelper

#archive_blogs, #blog_archive_menu, #blog_archive_month_submenu, #safe_params, #test_method

Instance Method Details

#indexObject



8
9
10
11
12
# File 'app/controllers/c/front_end/blogs_controller.rb', line 8

def index
  get_page C::Page, 'blogs'
  @blogs = C::Blog.order(created_at: 'DESC')
  archive_blogs
end

#showObject



14
15
16
17
18
19
# File 'app/controllers/c/front_end/blogs_controller.rb', line 14

def show
  get_page C::Blog
  @blog = @page
  redirect_to root_url unless @blog.published || user_signed_in?
  force_clean_url @blog
end