Sha256: d0a5b75e488e9cf495c26f08d656a77bb8e6e73b2aa70f8ae2e6204cc43fe2cc

Contents?: true

Size: 440 Bytes

Versions: 4

Compression:

Stored size: 440 Bytes

Contents

module Spina
  class PagesController < Spina::ApplicationController
    include Spina::Frontend

    before_action :current_spina_user_can_view_page?, except: [:robots]

    helper_method :page

    def homepage
      render_with_template(page)
    end

    private

      def current_spina_user_can_view_page?
        raise ActiveRecord::RecordNotFound if page.nil? || !page.live?

        current_spina_user.present?
      end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spina-1.0.3 app/controllers/spina/pages_controller.rb
spina-1.0.2 app/controllers/spina/pages_controller.rb
spina-1.0.1 app/controllers/spina/pages_controller.rb
spina-1.0.0 app/controllers/spina/pages_controller.rb