Skip to content

Instantly share code, notes, and snippets.

@mokevnin
Created September 8, 2012 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mokevnin/3673818 to your computer and use it in GitHub Desktop.
Save mokevnin/3673818 to your computer and use it in GitHub Desktop.
AutoMonitoring::Application.routes.draw do
mount Ckeditor::Engine => '/ckeditor'
namespace :api do
resources :employees, :only => [:update, :show] do
get :employees_without_department, :on => :collection
end
resources :juridical_people, :only => [:show]
resources :companies, :only => [:show] do
scope :module => :companies do
resources :people, :only => [:index]
resources :deals, :only => [:index, :show]
resources :counteragents, :only => [:index, :show]
end
end
resources :client_task_topics, :only => [:show]
resources :employee_positions, :only => [] do
scope :module => :employee_positions do
resources :privileges, :only => [:index]
end
end
resources :employee_departments, :only => [] do
scope :module => :employee_departments do
resources :employees, :only => [:index]
end
end
resources :product_items, :only => [:show]
resources :companies_tags, :only => [] do
get :autocomplete, :on => :collection
end
resources :phones, :only => [] do
get :exists, :on => :collection
end
resources :emails, :only => [] do
get :exists, :on => :collection
end
resources :current_month_payment, :only => [] do
get :month_number, :on => :collection
end
resources :search, :only => [:index]
resources :xdto_push, :only => [:create]
end
scope :module => 'web' do
root :to => 'welcome#index'
namespace :admin do
root :to => 'employees#index'
resources :employees, :only => [:index, :show, :new, :create, :edit, :update] do
put :trigger_state_event, :on => :member
scope :module => :employees do
resources :notes, :only => [:create]
end
end
resources :employees_departments
resources :employees_positions
resources :companies_categories
resources :companies_statuses
resources :juridical_people
resources :email_templates, :only => [:index, :edit, :update]
resources :client_task_topics, :only => [:index, :edit, :update, :new, :create, :destroy]
end
namespace :employee do
root :to => 'companies#index'
resources :companies, :only => [:index, :show, :new, :create, :edit, :update] do
put :del, :on => :member
scope :module => :companies do
resources :notes, :only => [:create]
resources :people, :only => [:new, :create, :edit, :update, :show] do
put :del, :on => :member
end
resources :invoices, :only => [:show] do
put :trigger_state_event, :on => :member
get :send_to_client, :on => :member
end
resources :deals, :only => [:show] do
put :del, :on => :member
end
resources :accounts, :only => [] do
put :del, :on => :member
end
resources :events, :only => [] do
put :del, :on => :member
end
resources :client_tasks, :only => [:show]
end
end
resources :companies_people, :only => [:index, :new, :create, :edit, :update] do
scope :module => :companies_people do
resources :notes, :only => [:create]
end
end
resources :companies_invoices, :only => [:index, :new, :create, :edit, :update] do
put :trigger_state_event, :on => :collection
scope :module => :companies_invoices do
resources :notes, :only => [:create]
end
end
resources :companies_invoices_packs do
put :apply, :on => :member
end
resources :companies_accounts, :only => [:index, :destroy]
resources :companies_crm_accounts
resources :companies_gis_accounts
resources :companies_deals, :only => [:index, :new, :create, :edit, :update]
resources :tasks, :only => [:index] do
put :trigger_state_event_many_tasks, :on => :collection
put :trigger_state_event, :on => :member
put :trigger_execution_state_event, :on => :member
put :take, :on => :member
end
resources :employee_tasks, :only => [:new, :create, :edit, :update, :show] do
scope :module => :employee_tasks do
resources :notes, :only => [:create]
end
end
resources :client_tasks, :only => [:new, :create, :edit, :update] do
scope :module => :client_tasks do
resources :notes, :only => [:create]
end
end
resources :mounters, :only => [:index, :show, :new, :create, :edit, :update] do
put :trigger_state_event, :on => :member
scope :module => :mounters do
resources :notes, :only => [:create]
end
end
resources :mounter_tasks_services do
scope :module => :mounter_tasks_services do
resources :notes, :only => [:create]
end
end
resources :tariffs
resources :events, :only => [:index, :show, :new, :create, :edit, :update]
resources :product_items
resources :objects_diagnostics_partials do
scope :module => :objects_diagnostics_partials do
resources :objects_diagnostics, :only => [:index]
end
put :apply, :on => :member
end
resource :session, :only => [:new, :create, :destroy]
resources :search, :only => [:index]
end
namespace :company do
root :to => 'deals#index'
resources :deals, :only => [:index, :show]
resources :invoices, :only => [:index, :show]
resources :client_tasks, :only => [:index, :show, :new, :create] do
put :reopen, :on => :member
scope :module => :client_tasks do
resources :notes, :only => [:create]
end
end
resources :mounter_tasks_services, :only => [:index, :show] do
scope :module => :mounter_tasks_services do
resources :notes, :only => [:create]
end
end
resources :accounts
resources :crm_accounts
resources :gis_accounts
resource :session, :only => [:new, :create, :destroy]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment