Class: Cms::ContentController

Inherits:
ApplicationController show all
Includes:
Attachments::Serving, ContentRenderingSupport, MobileAware
Defined in:
app/controllers/cms/content_controller.rb

Instance Method Summary collapse

Methods included from MobileAware

#determine_page_layout, #respond_as_mobile?, #select_cache_directory

Methods included from DefaultCaches

#cms_cache_directory, #mobile_cache_directory

Methods included from Attachments::Serving

#send_attachment, #send_attachments_with, send_attachments_with

Methods included from ContentRenderingSupport

#handle_access_denied_on_page, #handle_draft_not_found, #handle_not_found_on_page, #handle_server_error_on_page, #show_content_as_page

Methods inherited from ApplicationController

#no_browser_caching

Instance Method Details

#editObject

Used in the iframe to display a page that’s being editted.



40
41
42
43
44
45
# File 'app/controllers/cms/content_controller.rb', line 40

def edit
  @show_toolbar = true
  @mode = "edit"
  @page = Page.find_draft(params[:id].to_i)
  render_page
end

#instance_variables_for_renderingObject

Used by the rendering behavior



55
56
57
# File 'app/controllers/cms/content_controller.rb', line 55

def instance_variables_for_rendering
  instance_variables - (@initial_ivars || []) - ["@initial_ivars"]
end

#previewObject



47
48
49
50
51
52
# File 'app/controllers/cms/content_controller.rb', line 47

def preview
  @mode = "view"
  @page = Page.find_draft(params[:id].to_i)
  ensure_current_user_can_view(@page)
  render_page
end

#showObject

—– Actions ————————————————————–



24
25
26
27
28
29
30
31
# File 'app/controllers/cms/content_controller.rb', line 24

def show
  if @show_toolbar
    render_editing_frame
  else
    render_page
  end
  cache_if_eligible
end

#show_page_routeObject



33
34
35
36
37
# File 'app/controllers/cms/content_controller.rb', line 33

def show_page_route
  @_page_route.execute(self) if @_page_route
  render_page
  cache_if_eligible
end