Class: Spina::PagesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/spina/pages_controller.rb

Instance Method Summary collapse

Methods included from ApplicationHelper

#captcha, #current_account, #error_explanation!, #image_tag_with_at2x, #link_to_add_fields, #markdown

Instance Method Details

#homepageObject



5
6
7
# File 'app/controllers/spina/pages_controller.rb', line 5

def homepage
  render_with_template(page)
end

#showObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/spina/pages_controller.rb', line 9

def show
  if should_skip_to_first_child?
    if page.is_root?
      redirect_to spina.subpage_path(page, first_live_child) and return
    else
      redirect_to spina.third_level_page_path(page.parent, page, first_live_child) and return
    end
  elsif page.link_url.present?
    redirect_to page.link_url and return
  end

  render_with_template(page)
end