Class: Pwb::PagesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Pwb::PagesController
- Defined in:
- app/controllers/pwb/pages_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
default_url_options, #set_locale, #set_theme_path
Instance Method Details
#show_page ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/pwb/pages_controller.rb', line 7 def show_page default_page_slug = "home" page_slug = params[:page_slug] || default_page_slug @page = Pwb::Page.find_by_slug page_slug if @page.blank? @page = Pwb::Page.find_by_slug default_page_slug end @content_to_show = [] # @page.ordered_visible_contents.each do |page_content| # above does not get ordered correctly if @page.present? @page.ordered_visible_page_contents.each do |page_content| @content_to_show.push page_content.content.raw end end render "/pwb/pages/show" end |