Sha256: 9ff2c7b211954cec261cb3974e64ff7b07ef002785bdfdb2884a6643d13410e2

Contents?: true

Size: 650 Bytes

Versions: 1

Compression:

Stored size: 650 Bytes

Contents

class FrontEndController < ApplicationController

  include PushType::Filterable

  before_action :load_node, only: :show
  node_filters

  def show
    render *@node.template_args
  end

  private

  def root_path?
    request.fullpath == '/'
  end

  def raise_404
    if root_path?
      render template: 'push_type/setup', layout: nil, status: 404
    else
      raise ActiveRecord::RecordNotFound
    end
  end

  def load_node
    @node = PushType::Node.exposed.published.find_by_path permalink_path
    if @node
      instance_variable_set "@#{ @node.type.underscore }", @node.present!(view_context)
    else
      raise_404
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
push_type_core-0.10.0.beta.3 app/controllers/front_end_controller.rb