Sha256: fa248d33c97ba44da8863bdf1405ec5c2412ec07b46846b5c2c561de7c4adf4b

Contents?: true

Size: 535 Bytes

Versions: 8

Compression:

Stored size: 535 Bytes

Contents

module Dune::Admin
  def self.policy_class
    AdminPolicy
  end

  class BaseController < ::ApplicationController
    skip_before_filter :set_persistent_warning
    inherit_resources

    before_filter do
      authorize Dune::Admin, :access?
    end

    def update
      update! do |format|
        if resource.errors.empty?
          format.json { respond_with_bip(resource) }
        else
          format.html { render action: 'edit' }
          format.json { respond_with_bip(resource) }
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dune-admin-1.2.7 app/controllers/dune/admin/base_controller.rb
dune-admin-1.2.6 app/controllers/dune/admin/base_controller.rb
dune-admin-1.2.5 app/controllers/dune/admin/base_controller.rb
dune-admin-1.2.4 app/controllers/dune/admin/base_controller.rb
dune-admin-1.2.3 app/controllers/dune/admin/base_controller.rb
dune-admin-1.0.0 app/controllers/dune/admin/base_controller.rb
dune-admin-1.2.1 app/controllers/dune/admin/base_controller.rb
dune-admin-1.2.0 app/controllers/dune/admin/base_controller.rb