Sha256: 7b092370050af570e7a78019dfb1177e2a6ac8585360692e696171f19baf58a9

Contents?: true

Size: 479 Bytes

Versions: 7

Compression:

Stored size: 479 Bytes

Contents

class StaticContentController < Spree::BaseController
  caches_action :show
  
  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
  
  private
  
  def accurate_title
    @page ? @page.title : nil
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
spree_static_content-0.60.1 app/controllers/static_content_controller.rb
spree_static_content-0.60.0 app/controllers/static_content_controller.rb
spree_static_content-0.40.2 app/controllers/static_content_controller.rb
spree_static_content-0.40.1 app/controllers/static_content_controller.rb
spree_static_content-0.40.0 app/controllers/static_content_controller.rb
spree_static_content-0.30.0 app/controllers/static_content_controller.rb
spree_static_content-0.30.0.beta1 app/controllers/static_content_controller.rb