Class: SiteController

Inherits:
ApplicationController
  • Object
show all
Includes:
Radiant::Pagination::Controller
Defined in:
app/controllers/site_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Radiant::Pagination::Controller

#configure_pagination, included, #pagination_parameters

Class Method Details

.cache_timeoutObject



10
11
12
# File 'app/controllers/site_controller.rb', line 10

def self.cache_timeout
  @@cache_timeout ||= 5.minutes
end

Instance Method Details

#show_pageObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'app/controllers/site_controller.rb', line 14

def show_page
  url = params[:url]
  if Array === url
    url = url.join('/')
  else
    url = url.to_s
  end
  if @page = find_page(url)
    batch_page_status_refresh if (url == "/" || url == "")
    process_page(@page)
    set_cache_control
    self.response_body = response.body
  else
    render :template => 'site/not_found', :status => 404
  end
rescue Page::MissingRootPageError
  redirect_to welcome_url
end