Sha256: de1b845ff373c52fe23b9555be64b4b2885b2c9f907896e2b6604935f489541b

Contents?: true

Size: 1.25 KB

Versions: 5

Compression:

Stored size: 1.25 KB

Contents

MessageTrain::Engine.routes.draw do
  concern :boxable do
    resources(
      :boxes,
      path: 'box',
      param: :division,
      only: [:show, :update, :destroy]
    ) do
      resources :conversations, only: [:show, :update, :destroy]
      resources :messages, except: [:index, :destroy]
      get(
        'participants/:model',
        as: :model_participants,
        to: 'participants#index'
      )
      get(
        'participants/:model/:id',
        as: :model_participant,
        to: 'participants#show'
      )
    end
  end

  authenticated MessageTrain.configuration.user_route_authentication_method do
    concerns :boxable
    resources :collectives, as: :collective, only: [], concerns: :boxable
    post 'unsubscribes/all', to: 'unsubscribes#create', all: true
    delete 'unsubscribes/all', to: 'unsubscribes#destroy', all: true
    resources :unsubscribes, only: [:index, :create, :destroy]
  end

  match(
    '/box(/*path)',
    to: 'boxes#redirect_to_sign_in',
    via: [:get, :put, :post, :delete]
  )

  match(
    '/collectives(/*path)',
    to: 'boxes#redirect_to_sign_in',
    via: [:get, :put, :post, :delete]
  )

  match(
    '/unsubscribes(/*path)',
    to: 'unsubscribes#redirect_to_sign_in',
    via: [:get, :put, :post, :delete]
  )
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
message_train-0.7.6 config/routes.rb
message_train-0.7.5 config/routes.rb
message_train-0.7.3 config/routes.rb
message_train-0.7.2 config/routes.rb
message_train-0.7.1 config/routes.rb