Sha256: f771aef8f76a0bd29b78ff300b673eaf468a061f4881911d8eec00cf6937df5e

Contents?: true

Size: 1.58 KB

Versions: 19

Compression:

Stored size: 1.58 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)' => redirect do |_p, req|
      req.flash[:error] = :you_must_sign_in_or_sign_up_to_continue.l
      MessageTrain.configuration.user_sign_in_path
    end,
    via: [:get, :put, :post, :delete]
  )

  match(
    '/collectives(/*path)' => redirect do |_p, req|
      req.flash[:error] = :you_must_sign_in_or_sign_up_to_continue.l
      MessageTrain.configuration.user_sign_in_path
    end,
    via: [:get, :put, :post, :delete]
  )

  match(
    '/unsubscribes(/*path)' => redirect do |_p, req|
      req.flash[:error] = :you_must_sign_in_or_sign_up_to_continue.l
      MessageTrain.configuration.user_sign_in_path
    end,
    via: [:get, :put, :post, :delete]
  )
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
message_train-0.6.17 config/routes.rb
message_train-0.6.16 config/routes.rb
message_train-0.6.15 config/routes.rb
message_train-0.6.14 config/routes.rb
message_train-0.6.13 config/routes.rb
message_train-0.6.12 config/routes.rb
message_train-0.6.11 config/routes.rb
message_train-0.6.10 config/routes.rb
message_train-0.6.9 config/routes.rb
message_train-0.6.8 config/routes.rb
message_train-0.6.7 config/routes.rb
message_train-0.6.6 config/routes.rb
message_train-0.6.5 config/routes.rb
message_train-0.6.4 config/routes.rb
message_train-0.6.3 config/routes.rb
message_train-0.6.2 config/routes.rb
message_train-0.6.1 config/routes.rb
message_train-0.6.0 config/routes.rb
message_train-0.5.3 config/routes.rb