Sha256: 87d5a8c5b7976078b820c6be9d8b27f14d4939b0c37d5cb6a103df9a7e30537c
Contents?: true
Size: 867 Bytes
Versions: 10
Compression:
Stored size: 867 Bytes
Contents
module Avo class DynamicRouter def self.routes Avo::Engine.routes.draw do scope "resources", as: "resources" do # Check if the user chose to manually register the resource files. # If so, eager_load the resources dir. if Avo.configuration.resources.nil? Avo::App.eager_load(:resources) unless Rails.application.config.eager_load end Avo::Resources::ResourceManager.fetch_resources .select do |resource| resource != :BaseResource end .select do |resource| resource.is_a? Class end .map do |resource| resources resource.route_key do member do get :preview end end end end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems