config/precedence_routes.rb in scrivito_sdk-1.0.0 vs config/precedence_routes.rb in scrivito_sdk-1.1.0.rc1
- old
+ new
@@ -1,66 +1,69 @@
Rails.application.routes.draw do
mount Scrivito::SdkEngine, at: '/', as: :scrivito_engine
end
Scrivito::SdkEngine.routes.draw do
- resources :objs, controller: 'scrivito/objs', path: '__scrivito/objs',
- only: [:show, :create, :update, :destroy], defaults: {format: :json} do
- collection do
- get :page_class_selection
- get :search
- end
+ get 'scrivito', to: 'scrivito/ui#index'
+ get 'scrivito/*application_path', to: 'scrivito/ui#index', format: false
- member do
- get :widget
- get :widget_class_selection
- get :widget_modification
- get :conflicting_workspaces
- get :is_outdated
+ scope '__scrivito', module: 'scrivito' do
+ get ':id', to: 'cms_dispatch#index', as: :base_id, constraints: {id: /\h{16}/}
- post :copy
- post :duplicate
+ resources :objs, controller: 'objs', only: [:show, :create, :update, :destroy],
+ defaults: {format: :json} do
+ collection do
+ get :page_class_selection
+ get :search
+ end
- put :revert
- put :restore
- put :mark_resolved
- put :destroy_widget
- put :revert_widget
- put :restore_widget
- put :transfer_modifications
- end
- end
+ member do
+ get :widget
+ get :widget_class_selection
+ get :widget_modification
+ get :conflicting_workspaces
+ get :is_outdated
+ get :binary_no_cache
- resources :tasks, controller: 'scrivito/tasks', path: '__scrivito/tasks', only: [:show],
- defaults: {format: :json}
+ post :copy
+ post :duplicate
- get '__scrivito/blobs/upload_permission' => 'scrivito/blobs#upload_permission',
- defaults: {format: :json}
- put '__scrivito/blobs/activate_upload' => 'scrivito/blobs#activate_upload',
- defaults: {format: :json}
-
- resources :workspaces,
- controller: 'scrivito/workspaces',
- path: '__scrivito/workspaces',
- only: [:index, :show, :create, :update, :destroy],
- defaults: {format: :json} do
- member do
- put :rebase
- put :publish
- get :check
+ put :revert
+ put :restore
+ put :mark_resolved
+ put :destroy_widget
+ put :revert_widget
+ put :restore_widget
+ put :transfer_modifications
end
end
- get '__scrivito/users/suggest' => 'scrivito/users#suggest', defaults: {format: :json}
- get '__scrivito/suggest_completion' => 'scrivito/completion#suggest', defaults: {format: :json}
+ resources :tasks, controller: 'tasks', only: [:show], defaults: {format: :json}
- get '__scrivito/render_widget/:id/show_widget/:widget_id' => 'scrivito/cms_dispatch#show_widget'
- get '__scrivito/render_widget/:id/widget_details/:widget_id' => 'scrivito/cms_dispatch#widget_details'
+ get 'blobs/upload_permission' => 'blobs#upload_permission', defaults: {format: :json}
+ put 'blobs/activate_upload' => 'blobs#activate_upload', defaults: {format: :json}
- get '__scrivito/page_details/:id' => 'scrivito/cms_dispatch#page_details'
- get '__scrivito/resource_details/:resource_id', to: 'scrivito/ui#index'
+ 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 '__scrivito/to_binary' => 'scrivito/binary_redirect#to_binary', as: :binary
+ get 'users/suggest' => 'users#suggest', defaults: {format: :json}
+ get 'suggest_completion' => 'completion#suggest', defaults: {format: :json}
- get 'scrivito', to: 'scrivito/ui#index'
- get 'scrivito/*application_path', to: 'scrivito/ui#index', format: false
+ 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