Class: Workarea::Storefront::BlogsController

Inherits:
Storefront::ApplicationController
  • Object
show all
Defined in:
app/controllers/workarea/storefront/blogs_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



6
7
8
9
10
11
# File 'app/controllers/workarea/storefront/blogs_controller.rb', line 6

def index
  blogs = Workarea::Content::Blog.all.map do |blog|
    Storefront::BlogViewModel.new(blog, view_model_options)
  end
  @blog_index = Storefront::BlogIndexViewModel.new(blogs, view_model_options)
end

#showObject



13
14
15
16
# File 'app/controllers/workarea/storefront/blogs_controller.rb', line 13

def show
  model = Content::Blog.find_by(slug: params[:id])
  @blog = Storefront::BlogViewModel.new(model, view_model_options)
end