Sha256: b99707ce034445abebd4dac9d8e7897093e36b4e57d7fa854d6925adf07f3307

Contents?: true

Size: 630 Bytes

Versions: 1

Compression:

Stored size: 630 Bytes

Contents

module HyperAdmin
  class ResourceClassesController < ApplicationController
    respond_to :json

    def index
      collection = ::HyperAdmin.application.resources
      @resource_classes = collection.resources.values

      respond_with @resource_classes
    end

    def show
      collection = ::HyperAdmin.application.resources
      resource_classes = collection.resources.values

      @resource_class = resource_classes.find do |c|
        c.resource_class.model_name.route_key == params[:id]
      end

      fail ActiveRecord::RecordNotFound unless @resource_class

      respond_with @resource_class
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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