Class: PagesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- PagesController
- Defined in:
- lib/forge/app/controllers/pages_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#preview ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/forge/app/controllers/pages_controller.rb', line 16 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 |
#show ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/forge/app/controllers/pages_controller.rb', line 2 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 |