Class: Workarea::Storefront::ContentBlocksController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Workarea::Storefront::ContentBlocksController
- Defined in:
- app/controllers/workarea/storefront/content_blocks_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
#current_layout, #current_user_info, #health_check, #layout_content
Methods included from OrderLookup
Methods included from UserActivity
#current_user_activity_id, #user_activity
Methods included from CurrentCheckout
#clear_current_order, #completed_order, #completed_order=, #current_checkout, #current_order, #current_order=, #current_shipping, #current_shippings
Methods included from HttpCaching
Instance Method Details
#draft ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/workarea/storefront/content_blocks_controller.rb', line 25 def draft draft = Content::BlockDraft.find(params[:id]) @content = draft.content @block = Storefront::ContentBlockViewModel.wrap( draft.to_block, ) render :show end |
#new ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'app/controllers/workarea/storefront/content_blocks_controller.rb', line 9 def new @content = Content.find(params[:content_id]) block = @content.blocks.build(type_id: params[:type_id]) block.data = block.type.defaults @block = Storefront::ContentBlockViewModel.wrap(block, ) render :show end |
#show ⇒ Object
18 19 20 21 22 23 |
# File 'app/controllers/workarea/storefront/content_blocks_controller.rb', line 18 def show @content = Content.from_block(params[:id]) block = @content.blocks.find(params[:id]) @block = Storefront::ContentBlockViewModel.wrap(block, ) end |