app/controllers/effective/pages_controller.rb in effective_pages-1.0.12 vs app/controllers/effective/pages_controller.rb in effective_pages-1.0.13

- old
+ new

@@ -1,18 +1,19 @@ module Effective class PagesController < ApplicationController def show @pages = (Rails::VERSION::MAJOR > 3 ? Effective::Page.all : Effective::Page.scoped) - @pages = @pages.published if params[:edit].to_s != 'true' + @pages = @pages.published unless (params[:edit] || params[:preview]) @page = @pages.find(params[:id]) raise ActiveRecord::RecordNotFound unless @page.present? # Incase .find() isn't raising it raise Effective::AccessDenied unless @page.roles_permit?(current_user) EffectivePages.authorized?(self, :show, @page) @page_title = @page.title + @meta_description = @page.meta_description render @page.template, :layout => @page.layout, :locals => {:page => @page} end end end