Sha256: 293ce8aa167a87aa5abcca21f8df1f4f37f379bb7ab776e9f9bd91c84e577d65
Contents?: true
Size: 984 Bytes
Versions: 2
Compression:
Stored size: 984 Bytes
Contents
module Refinery module Pages module InstanceMethods def self.included(base) base.send :helper_method, :refinery_menu_pages end def error_404(exception=nil) if (@page = ::Refinery::Page.where(:menu_match => "^/404$").includes(:parts).first).present? # render the application's custom 404 page with layout and meta. render :template => '/refinery/pages/show', :formats => [:html], :status => 404 return false else super end end # Compiles the default menu. def refinery_menu_pages ::Refinery::Menu.new(::Refinery::Page.fast_menu) end protected def render(*args) present(@page) unless admin? or @meta.present? super end private def store_current_location! return super if admin? session[:website_return_to] = refinery.url_for(@page.url) if @page && @page.persisted? end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
refinerycms-pages-2.0.1 | lib/refinery/pages/instance_methods.rb |
refinerycms-pages-2.0.0 | lib/refinery/pages/instance_methods.rb |