Class: Workarea::Storefront::BlogsController
- Inherits:
-
Storefront::ApplicationController
- Object
- Storefront::ApplicationController
- Workarea::Storefront::BlogsController
- Defined in:
- app/controllers/workarea/storefront/blogs_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
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, ) end @blog_index = Storefront::BlogIndexViewModel.new(blogs, ) end |
#show ⇒ Object
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, ) end |