Sha256: 16cf37bd775689e2ff160001d1d413a9d6ea13dcb7f91978768ef332c05dacb2
Contents?: true
Size: 806 Bytes
Versions: 5
Compression:
Stored size: 806 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.now[:warning] = "This page is not yet published and will not appear on your live website." end render :action => :show end end
Version data entries
5 entries across 5 versions & 1 rubygems