Sha256: aeec795d513be9ca79a1f1f6e0ad47ece25135ad28f11edf086f5bf153e25a51

Contents?: true

Size: 1.05 KB

Versions: 5

Compression:

Stored size: 1.05 KB

Contents

require 'thredded/setup_thredded'

Thredded::Engine.routes.draw do
  post '/mail/receive' => 'emails#create', as: :mail_receive

  constraints(Thredded::SetupThredded.new) do
    resources :setups, path: '', only: [:new, :create]
    root to: 'setups#new'
  end

  constraints(lambda{|req| req.env['QUERY_STRING'].include? 'q=' }) do
    get '/:messageboard_id(.:format)' => 'topics#search', as: :messageboard_search
  end

  get '/:messageboard_id/preferences/edit' => 'preferences#edit'
  get '/:messageboard_id/new(.:format)' => 'topics#new', as: :new_messageboard_topic
  get '/:messageboard_id/:id/edit(.:format)' => 'topics#edit', as: :edit_messageboard_topic
  get '/:messageboard_id/:topic_id/:page(.:format)' => 'posts#index',
    as: :paged_messageboard_topic_posts, constraints: { page: /\d+/ }

  resources :messageboards, only: [:index], path: '' do
    resource :preferences, only: [:edit, :update]
    resources :private_topics, only: [:new, :create, :index]

    resources :topics, except: [:show], path: '' do
      resources :posts, path: ''
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
thredded-0.0.7 config/routes.rb
thredded-0.0.6 config/routes.rb
thredded-0.0.5 config/routes.rb
thredded-0.0.4 config/routes.rb
thredded-0.0.3 config/routes.rb