TariffWeb::Application.routes.draw do
  match "/search" => "search#search", via: :get, as: :perform_search

  resources :sections, only: [:index, :show]
  resources :chapters, only: [:index, :show]
  resources :headings, only: [:index, :show]
  resources :commodities, only: [:index, :show]

  root to: 'pages#index'
end

TariffWeb::Application.routes.draw do
  scope :path => "#{APP_SLUG}" do
    get "/" => "pages#index"
    match "/search" => "search#search", via: :get, as: :perform_search

    resources :sections, only: [:index, :show]
    resources :chapters, only: [:index, :show]
    resources :headings, only: [:index, :show]
    resources :commodities, only: [:index, :show]
  end

  root :to => redirect("/#{APP_SLUG}", :status => 302)
end

Use the APP_SLUG as we're using a prefix route
Use the APP_SLUG as we're using a prefix route

This is required as the router is horrible to all of us. It
expects apps to handle this scope shift for the slug they're
using.

This just mitigates this deficiency in the router.
