Rails.application.routes.draw do get "up" => "rails/health#show", as: :rails_health_check get "login", to: "sessions#new" post "login", to: "sessions#create" delete "logout", to: "sessions#destroy" resource :password, only: %i[edit update] resources :password_resets, only: %i[new create], path: "password_reset" do collection do get ":token/edit", action: :edit, as: :edit patch ":token", action: :update, as: :update end end # Launcher: scegli il progetto (istanza CRM) root "home#index" get "impostazioni", to: "admin#show", as: :admin # CRUD progetti anche fuori da un'istanza (bootstrap admin) resources :projects, only: %i[create edit update destroy] resources :users, except: %i[show] resources :mail_identities, except: %i[show] # Ogni progetto = istanza CRM dedicata scope "/p/:project_code" do get "/", to: "dashboard#show", as: :project_root get "/today", to: "today#show", as: :today get "/pipeline", to: "pipeline#show", as: :pipeline get "/search", to: "search#show", as: :search get "/reports", to: "reports#index", as: :reports get "/settings", to: "settings#show", as: :settings patch "/settings/goal(/:id)", to: "settings#update_goal", as: :update_goal_settings resources :organizations do resources :activities, only: %i[create] end resources :contacts resources :opportunities do member do patch :update_stage end end resources :tasks do member do patch :complete end end resources :imports, only: %i[new create] resources :mail_templates, except: %i[show] resources :mail_images, only: %i[create] resources :mailings do collection do get :dashboard end member do post :queue post :cancel post :test_send get :test_preview post :refresh_recipients patch :update_recipients get :preview end end end end