DynamoMTL/mercury-engine

View on GitHub
app/controllers/pages_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
class PagesController < ApplicationController
  include PagesHelper
  protect_from_forgery
  before_filter :authenticate_admin_user!, except: :show

  def show
    path  = params[:path]
    @page = Page.find_by_path(path)
    append_view_path 'app/views/pages'

    render action: template_path(path)
  end

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

    render text: ''
  end
end