Sha256: 2fb4387cfad14f4469c48c786de3a382aae54409a099a3d317d86c93439a6479

Contents?: true

Size: 579 Bytes

Versions: 2

Compression:

Stored size: 579 Bytes

Contents

# frozen_string_literal: true

class ::Tramway::Page::PagesController < ::Tramway::Page::ApplicationController
  layout 'tramway/landing/application'

  def show
    @page = ::Tramway::Page::Page.find_by slug: params[:slug]
    @blocks = @page.blocks.published.active.map do |block|
      if block.block_type.header_with_form? && block.form_url.present?
        # FIXME in future
        @header_with_form = block.form_to_render.new(Tramway::Auth.authenticable_models.first.new, page: @page.id)
      end
      ::Tramway::Landing::BlockDecorator.decorate block
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tramway-page-1.5 app/controllers/tramway/page/pages_controller.rb
tramway-page-1.4.2 app/controllers/tramway/page/pages_controller.rb