Module: Refinery::Pages::InstanceMethods

Included in:
Admin::PagesController, Admin::PreviewController
Defined in:
lib/refinery/pages/instance_methods.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
# File 'lib/refinery/pages/instance_methods.rb', line 5

def self.included(base)
  base.send :helper_method, :refinery_menu_pages
  base.send :alias_method_chain, :render, :presenters
end

Instance Method Details

#error_404(exception = nil) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/refinery/pages/instance_methods.rb', line 10

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.
    if self.respond_to? :render_with_templates?, true
      render_with_templates? @page, :status => 404
    else
      render :template => '/refinery/pages/show', :formats => [:html], :status => 404
    end
    return false
  else
    super
  end
end

#refinery_menu_pagesObject

Compiles the default menu.



25
26
27
# File 'lib/refinery/pages/instance_methods.rb', line 25

def refinery_menu_pages
  Menu.new Page.fast_menu
end