Sha256: 6281301e247edc985492b1674064d5cabb68763f82f9f1cddf4fdd5fe712929d

Contents?: true

Size: 733 Bytes

Versions: 40

Compression:

Stored size: 733 Bytes

Contents

module Admin
  class PagesController < ApplicationController
    before_action(:authenticate_user!) if defined?(Devise)
    before_action { EffectiveResources.authorize!(self, :admin, :effective_pages) }

    include Effective::CrudController

    if (config = EffectivePages.layout)
      layout(config.kind_of?(Hash) ? config[:admin] : config)
    end

    submit :save, 'Save'
    submit :save, 'Save and Add New', redirect: :new
    submit :save, 'Save and View', redirect: -> { effective_pages.page_path(resource) }
    submit :save, 'Duplicate', only: :edit, redirect: -> { effective_pages.new_admin_page_path(duplicate_id: resource) }

    def permitted_params
      params.require(:effective_page).permit!
    end

  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
effective_pages-3.13.4 app/controllers/admin/pages_controller.rb
effective_pages-3.13.3 app/controllers/admin/pages_controller.rb
effective_pages-3.13.2 app/controllers/admin/pages_controller.rb
effective_pages-3.13.1 app/controllers/admin/pages_controller.rb
effective_pages-3.13.0 app/controllers/admin/pages_controller.rb
effective_pages-3.12.0 app/controllers/admin/pages_controller.rb
effective_pages-3.11.0 app/controllers/admin/pages_controller.rb
effective_pages-3.10.3 app/controllers/admin/pages_controller.rb
effective_pages-3.10.2 app/controllers/admin/pages_controller.rb
effective_pages-3.10.1 app/controllers/admin/pages_controller.rb
effective_pages-3.10.0 app/controllers/admin/pages_controller.rb
effective_pages-3.9.0 app/controllers/admin/pages_controller.rb
effective_pages-3.8.4 app/controllers/admin/pages_controller.rb
effective_pages-3.8.3 app/controllers/admin/pages_controller.rb
effective_pages-3.8.2 app/controllers/admin/pages_controller.rb
effective_pages-3.8.1 app/controllers/admin/pages_controller.rb
effective_pages-3.8.0 app/controllers/admin/pages_controller.rb
effective_pages-3.7.11 app/controllers/admin/pages_controller.rb
effective_pages-3.7.10 app/controllers/admin/pages_controller.rb
effective_pages-3.7.9 app/controllers/admin/pages_controller.rb