Skip to content

Commit

Permalink
Q&A preview_controller
Browse files Browse the repository at this point in the history
* Remove layout def, we use render_with_templates? method
* Improve page_params (:custom_slug was missing)
  • Loading branch information
bricesanchez committed May 11, 2016
1 parent 530cd1a commit 85f9258
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pages/app/controllers/refinery/pages/admin/preview_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ class PreviewController < Refinery::PagesController

skip_before_action :error_404, :set_canonical

layout :layout

def show
render_with_templates?
end
Expand All @@ -33,16 +31,18 @@ def find_page
end
alias_method :page, :find_page

def layout
'application'
def page_params
params.require(:page).permit(permitted_page_params)
end

def page_params
params.require(:page).permit(
private

def permitted_page_params
[
:browser_title, :draft, :link_url, :menu_title, :meta_description,
:parent_id, :skip_to_first_child, :show_in_menu, :title, :view_template,
:layout_template, parts_attributes: [:id, :title, :body, :position]
)
:layout_template, :custom_slug, parts_attributes: [:id, :title, :slug, :body, :position]
]
end
end
end
Expand Down

0 comments on commit 85f9258

Please sign in to comment.