6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'app/controllers/tramway/page/pages_controller.rb', line 6
def show
@application = ::Tramway::Core.application_object @page = ::Tramway::Page::Page.published.find_by slug: params[:slug]
@blocks = @page.blocks.published.active.map do |block|
if block.block_type. && block.form_url.present?
@header_with_form = block.form_to_render.new(Tramway::Auth.authenticable_models.first.new, page: @page.id)
end
if block.block_type.in? %i[header header_with_form]
@links = Tramway::Landing::BlockLinkDecorator.decorate @page.with_navbar_link.active
end
::Tramway::Landing::BlockDecorator.decorate block
end
end
|