Sha256: ee71a0c33dfd9fb596146fa536422c8ad143241c450364979f77a52b00c924be
Contents?: true
Size: 802 Bytes
Versions: 19
Compression:
Stored size: 802 Bytes
Contents
class PagesController < ApplicationController def show @page = current_user.blank? ? Page.published.find_by_path!("/#{params[:slugs]}") : Page.find_by_path!("/#{params[:slugs]}") @page_title = @page.seo_title.blank? ? @page.title : @page.seo_title if @page.key == "contact-us" redirect_to contact_index_path if @page.key == "contact-us" else respond_to do |format| format.html { } format.mobile { render :template => "mobile/page" } end end end def preview @page = Page.new(params[:page]) @page_title = @page.seo_title.blank? ? @page.title : @page.seo_title unless @page.published? flash[:warning] = "This page is not yet published and will not appear on your live website." end render :action => :show end end
Version data entries
19 entries across 19 versions & 1 rubygems