Class: Compartment::PagesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/compartment/pages_controller.rb

Instance Attribute Summary

Attributes inherited from ApplicationController

#current_site

Instance Method Summary collapse

Methods inherited from ApplicationController

#find_site_by_domain

Instance Method Details

#showObject



6
7
8
9
10
11
12
13
14
# File 'app/controllers/compartment/pages_controller.rb', line 6

def show
  @page = current_site.pages.find_by_url_path(request.path_info)
  if @page
    render :file => @page.template_path, layout: false
  else
    # render 'compartment/errors/page_not_found', :status => 404
    render file: current_site.theme.path_to_template(:page_not_found), status: 404, layout: false
  end
end