Sha256: a8e72df636b2aa8c3d62234176952ff33dd8873c6561d833027320156c3ed612

Contents?: true

Size: 551 Bytes

Versions: 6

Compression:

Stored size: 551 Bytes

Contents

module Workarea
  module Storefront
    class BlogsController < Storefront::ApplicationController
      before_action :cache_page

      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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
workarea-blog-3.5.2 app/controllers/workarea/storefront/blogs_controller.rb
workarea-blog-3.5.1 app/controllers/workarea/storefront/blogs_controller.rb
workarea-blog-3.5.0 app/controllers/workarea/storefront/blogs_controller.rb
workarea-blog-3.4.9 app/controllers/workarea/storefront/blogs_controller.rb
workarea-blog-3.4.8 app/controllers/workarea/storefront/blogs_controller.rb
workarea-blog-3.4.7 app/controllers/workarea/storefront/blogs_controller.rb