Class: PagesController

Inherits:
ApplicationController
  • Object
show all
Includes:
PagesHelper
Defined in:
app/controllers/pages_controller.rb

Constant Summary

Constants included from PagesHelper

PagesHelper::SIMPLE_TAGS

Instance Method Summary collapse

Methods included from PagesHelper

#content_for, #editable, #editable_image, #find_type_for_tag, #format_content, #set_mercury_options, #template_path, #title

Instance Method Details

#showObject



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

def show
  path  = params[:path]
  @page = Page.find_by_path(path)

  render action: template_path(path)
end

#updateObject



13
14
15
16
17
# File 'app/controllers/pages_controller.rb', line 13

def update
  Page.update_content(params[:path], format_content(params[:content]))

  render text: ''
end