Class: Spree::StaticContentController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/static_content_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/spree/static_content_controller.rb', line 5

def show
  path = case params[:path]
  when Array
    '/' + params[:path].join("/")
  when String
    '/' + params[:path]
  when nil
    request.path
  end

  unless @page = Spree::Page.visible.find_by_slug(path.gsub('//','/'))
    render_404
  end
end