Class: Workarea::Storefront::ContentBlocksController
Instance Method Summary
collapse
#current_layout, #current_user_info, #health_check, #layout_content
#lookup_order, #lookup_order=
#clear_current_order, #completed_order, #completed_order=, #current_checkout, #current_order, #current_order=, #current_shipping, #current_shippings, #logout
Instance Method Details
#draft ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
|
# File 'app/controllers/workarea/storefront/content_blocks_controller.rb', line 26
def draft
draft = Content::BlockDraft.find(params[:id])
@content = draft.content
@block = Storefront::ContentBlockViewModel.wrap(
draft.to_block,
view_model_options
)
render :show
end
|
#new ⇒ Object
10
11
12
13
14
15
16
17
|
# File 'app/controllers/workarea/storefront/content_blocks_controller.rb', line 10
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, view_model_options)
render :show
end
|
#show ⇒ Object
19
20
21
22
23
24
|
# File 'app/controllers/workarea/storefront/content_blocks_controller.rb', line 19
def show
@content = Content.from_block(params[:id])
block = @content.blocks.find(params[:id])
@block = Storefront::ContentBlockViewModel.wrap(block, view_model_options)
end
|