Sha256: 60ab450cfa13eb05eedd16d37e93203a9df045c4cfc7041b367657b7edca5cd4

Contents?: true

Size: 502 Bytes

Versions: 3

Compression:

Stored size: 502 Bytes

Contents

module Ecm::CoreInfo::Backend
  class GemsController < Itsf::Backend::Resource::BaseController
    using Ecm::CoreInfo

    def self.resource_class
      Ecm::CoreInfo::Gem
    end

    private

    def to_param_method
      :name
    end

    def collection_scope
      if Itsf::Backend.features?(:kaminari)
        Kaminari.paginate_array(resource_class.find_all.to_a)
      else
        super
      end
    end

    def load_resource
      resource_class.find_by_name(params[:id])
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ecm_core_info_backend-0.0.4 app/controllers/ecm/core_info/backend/gems_controller.rb
ecm_core_info_backend-0.0.3 app/controllers/ecm/core_info/backend/gems_controller.rb
ecm_core_info_backend-0.0.2 app/controllers/ecm/core_info/backend/gems_controller.rb