Sha256: 83dc9c7b5d5ea652047a8f5fb50754dfe22152344c41a48707f288072a979256

Contents?: true

Size: 452 Bytes

Versions: 1

Compression:

Stored size: 452 Bytes

Contents

require_dependency "madmin/resources"

module Madmin
  class BaseController < ActionController::Base
    before_action :validate_resources

    private

    # Taking a peek at all the resources will raise an error if one isn't found.
    # Let's inform the user if we can't find a resource no matter what page
    # they're on. This should fail to prevent surprises at run time.
    def validate_resources
      Madmin::Resources.all
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
madmin-0.1.0 app/controllers/madmin/base_controller.rb