Sha256: 92d8a39754d3966377ec21b6928197bd3a8ffb43b5c752fceac629ed305c24e4

Contents?: true

Size: 1.83 KB

Versions: 2

Compression:

Stored size: 1.83 KB

Contents

require 'sidekiq/web'
require 'sidekiq/cron/web'

Rails.application.routes.draw do

  Sidekiq::Web.use Rack::Auth::Basic do |username, password|
    username == Settings.sidekiq.username && password == Settings.sidekiq.password
  end if Rails.env.production?
  mount Sidekiq::Web, at: '/sidekiq'

  concern :activeable do
    post :toggle_is_active, on: :member
  end

  # Admins
  devise_for :admins, controllers: { sessions: 'hq/sessions', registrations: 'hq/registrations', passwords: 'hq/passwords' }, path: 'hq',
             path_names: { sign_in: 'login', sign_out: 'logout', password: 'secret',  confirmation: 'verification' }
  as :admin do
    get 'hq/edit' => 'hq/registrations#edit', as: 'edit_admin_registration'
    put 'hq' => 'hq/registrations#update', as: 'admin_registration'
  end
  namespace :hq do
    root to: 'dashboard#index'
    resources :dashboard, only: [:index]
    resources :admins, concerns: [:activeable]
    resources :users, concerns: [:activeable]
    resources :countries
    resources :cities
    resources :audits, only: [:index, :show]
  end
  # Users
  devise_for :users, controllers: { sessions: 'user/sessions', registrations: 'user/registrations', passwords: 'user/passwords' }, path: 'user',
             path_names: { sign_in: 'login', sign_out: 'logout', password: 'secret',  confirmation: 'verification' }
  as :user do
    get 'user/edit' => 'user/registrations#edit', as: 'edit_user_profile_registration'
    put 'user' => 'user/registrations#update', as: 'user_profile_registration'
  end
  namespace :user do
    root to: 'dashboard#index'
    resources :dashboard, only: [:index]
    resources :profile, only: [:index, :edit, :update]
  end

  # Common pages
  root to: 'welcome#index'

  if Rails.env.production? or Rails.env.staging?
    match '*unmatched_route', to: 'application#page_not_found', via: :all
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cybele-1.9.1 templates/config/routes.erb
cybele-1.9.0 templates/config/routes.erb