Sha256: 4baaf0d5691a428eb0dab1781ee4025b289a55668c571a21a3a95b0b8425f8f7

Contents?: true

Size: 448 Bytes

Versions: 1

Compression:

Stored size: 448 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_404
    end
  end
  
  private
  
  def accurate_title
    @page ? (@page.meta_title ? @page.meta_title : @page.title) : nil
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree_static_content-0.70.3 app/controllers/static_content_controller.rb