Sha256: 5f4caaefc59b53c7a9d6e0a58eb34338809b3e09970563dc8a46c3d89d7c93c0

Contents?: true

Size: 497 Bytes

Versions: 1

Compression:

Stored size: 497 Bytes

Contents

require_dependency "storytime/application_controller"

module Storytime
  class PagesController < ApplicationController
    before_action :ensure_site, unless: ->{ params[:controller] == "storytime/dashboard/sites" }
    def show
      params[:id] = Site.selected_root_page_id if request.path == "/"
      
      @page = Page.published.friendly.find(params[:id])

      if request.path != page_path(@page)
        return redirect_to @page, :status => :moved_permanently
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
storytime-0.0.1 app/controllers/storytime/pages_controller.rb