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