Module: PagesHelper

Defined in:
app/helpers/pages_helper.rb

Instance Method Summary collapse

Instance Method Details

#page_path(page) ⇒ Object

Override page_path helper to generate Wordpress-style permalinks for published pages.


4
5
6
7
8
9
10
# File 'app/helpers/pages_helper.rb', line 4

def page_path(page)
  if page.published?
    "/#{page.slug}/"
  else
    "/pages/#{page.id}"
  end
end