Class: StaticContentController

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

Instance Method Summary collapse

Instance Method Details

#showObject



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

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

  unless @page = Page.visible.find_by_slug(path)
    render :file => "#{RAILS_ROOT}/public/404.html", :layout => false, :status => 404
  end
end