Rails.application.routes.draw do mount Scrivito::SdkEngine, at: '/', as: :scrivito_engine end Scrivito::SdkEngine.routes.draw do get 'scrivito', to: 'scrivito/ui#index' get 'scrivito/*application_path', to: 'scrivito/ui#index', format: false scope '__scrivito', module: 'scrivito' do get ':id', to: 'cms_dispatch#index', as: :base_id, constraints: {id: /\h{16}/} resources :objs, controller: 'objs', only: [:show, :create, :update, :destroy], defaults: {format: :json} do collection do get :page_class_selection get :search end member do get :widget get :widget_class_selection get :widget_modification get :conflicting_workspaces get :is_outdated get :binary_no_cache post :copy post :duplicate put :revert put :restore put :mark_resolved put :destroy_widget put :revert_widget put :restore_widget put :transfer_modifications end end resources :tasks, controller: 'tasks', only: [:show], defaults: {format: :json} get 'blobs/upload_permission' => 'blobs#upload_permission', defaults: {format: :json} put 'blobs/activate_upload' => 'blobs#activate_upload', defaults: {format: :json} resources :workspaces, controller: 'workspaces', only: [:index, :show, :create, :destroy], defaults: {format: :json} do member do put :rename put :memberships put :rebase put :publish get :check end end get 'users/suggest' => 'users#suggest', defaults: {format: :json} get 'suggest_completion' => 'completion#suggest', defaults: {format: :json} get 'render_widget/:id/show_widget/:widget_id' => 'cms_dispatch#show_widget' get 'render_widget/:id/widget_details/:widget_id' => 'cms_dispatch#widget_details' get 'page_details/:id' => 'cms_dispatch#page_details' get 'resource_details/:resource_id', to: 'ui#index' get 'to_binary' => 'binary_redirect#to_binary', as: :binary end end