Sha256: 55c927df71462917c11be5fd961f2f5e404450982d6fc2397da7be54e293faf3

Contents?: true

Size: 1.71 KB

Versions: 2

Compression:

Stored size: 1.71 KB

Contents

Rails.application.routes.draw do

  namespace :admin do
    root to: 'dashboards#index'
    get 'dashboards', as: 'dashboards'

    resources :structures do
      post :batch, :rebuild, on: :collection
      resource :static_page
    end

    resources :users do
      post :batch, on: :collection
      post :activate, :suspend, on: :member
    end

    resources :assets, only: [:create, :destroy] do
      post :rotate, :main, :crop, on: :member
      post :sort, on: :collection
      get :batch_edit, on: :collection
      post :batch_update, on: :collection
    end

    resource :settings, only: [:edit, :update] do
      post :cache_clear, on: :collection
    end

    resource :locators do
      post :prepare, :reload, on: :collection
    end

    resources :admin_comments

    post 'translate' => AbAdmin::I18nTools::TranslateApp

    controller 'manager', constraints: {format: /(html|js|json|xml|csv|xls|xlsx)/} do
      scope '(/:parent_resource/:parent_resource_id)/:model_name' do
        get '/new', action: :new, as: 'new'
        post '/batch', action: :batch, as: 'batch'
        post '/rebuild', action: :rebuild, as: 'rebuild'
        match '/custom_action', action: :custom_action, as: 'collection_action', via: :all

        scope ':id' do
          get '/edit', action: :edit, as: 'edit'
          get '/history', action: :history, as: 'history'
          match '/custom_action', action: :custom_action, as: 'member_action', via: :all
          get '/', action: :show, as: 'show'
          patch '/', action: :update, as: 'update'
          delete '/', action: :destroy, as: 'destroy'
        end

        get '/', action: :index, as: 'index'
        post '/', action: :create, as: 'create'
      end
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ab_admin-0.6.1 config/routes.rb
ab_admin-0.6.0 config/routes.rb