Sha256: c5dead309af8024fcd1f25a6a72ae9ee65b8e69f7eb77d33274ac5c866a87c0f

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 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-: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

4 entries across 4 versions & 1 rubygems

Version Path
thredded-0.0.12 config/routes.rb
thredded-0.0.10 config/routes.rb
thredded-0.0.9 config/routes.rb
thredded-0.0.8 config/routes.rb