Sha256: 21ba7a5b36e92402545827c2c12dcc547e7938e05ec62afbdcaaf225b925228b

Contents?: true

Size: 1.94 KB

Versions: 5

Compression:

Stored size: 1.94 KB

Contents

# frozen_string_literal: true

Motor::Admin.routes.draw do
  namespace :motor, path: '' do
    scope 'api', as: 'api' do
      resources :run_queries, only: %i[show create]
      resources :send_alerts, only: %i[create]
      resources :queries, only: %i[index show create update destroy]
      resources :tags, only: %i[index]
      resources :configs, only: %i[index create]
      resources :resources, only: %i[index create]
      resources :resource_methods, only: %i[show], param: 'resource'
      resources :dashboards, only: %i[index show create update destroy]
      resources :forms, only: %i[index show create update destroy]
      resources :alerts, only: %i[index show create update destroy]
      resources :active_storage_attachments, only: %i[create], path: 'data/active_storage__attachments'
      resource :schema, only: %i[show update]
      resources :resources, path: '/data/:resource',
                            only: %i[index show update create destroy],
                            controller: 'data' do
        put '/:method', to: 'data#execute'
        resources :association, path: '/:association',
                                only: %i[index create],
                                controller: 'data'
      end
    end

    resources :assets, param: 'filename',
                       only: :show,
                       format: false,
                       constraints: { filename: /.+/ }

    get '/', to: 'ui#show'

    scope as: 'ui' do
      with_options controller: 'ui' do
        resources :data, only: %i[index show],
                         param: 'path',
                         constraints: { path: /.+/ }
        resources :reports, only: %i[index show]
        resources :queries, only: %i[index show]
        resources :dashboards, only: %i[index show]
        resources :alerts, only: %i[index show]
        resources :forms, only: %i[index show]
      end
    end
  end
end

ActiveSupport::Notifications.instrument('motor.routes.loaded')

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
motor-admin-0.1.35 config/routes.rb
motor-admin-0.1.34 config/routes.rb
motor-admin-0.1.33 config/routes.rb
motor-admin-0.1.32 config/routes.rb
motor-admin-0.1.31 config/routes.rb