Sha256: b7c42a1b9ebd5b67bca72380d54efdbec22a65b97cbcd3bf2764d7dec25b6714

Contents?: true

Size: 577 Bytes

Versions: 1

Compression:

Stored size: 577 Bytes

Contents

module HyperAdmin
  class ResourceClassesController < ApplicationController
    respond_to :json

    def index
      collection = ::HyperAdmin.application.resources
      @resource_classes = collection.resources.values.map(&:resource_class)

      respond_with @resource_classes
    end

    def show
      collection = ::HyperAdmin.application.resources
      resource_classes = collection.resources.values.map(&:resource_class)
      @resource_class = resource_classes.find { |c| c.model_name.route_key == params[:id] }

      respond_with @resource_class
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hyper_admin-0.3.0 app/controllers/hyper_admin/resource_classes_controller.rb