Sha256: 597a495f3a38ea76dd6778113eacfa97b6af1d3c1aac1d35c7604907a522a2cb

Contents?: true

Size: 669 Bytes

Versions: 14

Compression:

Stored size: 669 Bytes

Contents

class FrontEndController < ApplicationController

  include PushType::Filterable

  before_action :load_node, only: :show
  hooks_for :node, only: :show

  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: false, 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

14 entries across 14 versions & 1 rubygems

Version Path
push_type_core-0.9.5 app/controllers/front_end_controller.rb
push_type_core-0.9.3 app/controllers/front_end_controller.rb
push_type_core-0.9.2 app/controllers/front_end_controller.rb
push_type_core-0.9.1 app/controllers/front_end_controller.rb
push_type_core-0.9.0 app/controllers/front_end_controller.rb
push_type_core-0.9.0.beta.4 app/controllers/front_end_controller.rb
push_type_core-0.9.0.beta.3 app/controllers/front_end_controller.rb
push_type_core-0.9.0.beta.2 app/controllers/front_end_controller.rb
push_type_core-0.8.2 app/controllers/front_end_controller.rb
push_type_core-0.8.1 app/controllers/front_end_controller.rb
push_type_core-0.8.0 app/controllers/front_end_controller.rb
push_type_core-0.8.0.beta.3 app/controllers/front_end_controller.rb
push_type_core-0.8.0.beta.2 app/controllers/front_end_controller.rb
push_type_core-0.8.0.beta.1 app/controllers/front_end_controller.rb