ファイル
btrc-hub/backend/config/routes.rb
T
2026-06-09 08:17:16 +09:00

108 行
2.6 KiB
Ruby

Rails.application.routes.draw do
resources :nico_tags, path: 'tags/nico', only: [:index, :update]
scope 'tags/:parent_id/children', controller: :tag_children do
post ':child_id', action: :create
delete ':child_id', action: :destroy
end
resources :tags, only: [:index, :show] do
collection do
get :autocomplete
get :'with-depth', action: :with_depth
get :versions, to: 'tag_versions#index'
scope :name do
get ':name/deerjikists', action: :deerjikists_by_name
get ':name/materials', action: :materials_by_name
get ':name', action: :show_by_name
end
end
member do
put '', action: :update_all
patch '', action: :update
get :deerjikists
put :deerjikists, action: :update_deerjikists
end
end
scope :preview, controller: :preview do
get :title
get :thumbnail
end
resources :wiki_pages, path: 'wiki', only: [:index, :show, :create, :update] do
collection do
get :search
get :changes
scope :title do
get ':title/exists', action: :exists_by_title
get ':title', action: :show_by_title
end
end
member do
get :exists
get :diff
end
end
resources :posts, only: [:index, :show, :create, :update] do
collection do
get :random
get :changes
get :versions, to: 'post_versions#index'
end
member do
post :viewed
delete :viewed, action: :unviewed
end
end
namespace :gekanator do
resources :games, only: [:create], controller: '/gekanator_games'
resources :posts, only: [:index], controller: '/gekanator_posts'
resources :question_suggestions,
only: [:create],
controller: '/gekanator_question_suggestions'
end
resources :users, only: [:create, :update] do
collection do
post :verify
get :me
post 'code/renew', action: :renew
end
end
resources :deerjikists, only: [] do
collection do
scope ':platform/:code' do
get '', action: :show
put '', action: :update
delete '', action: :destroy
end
end
end
resources :theatres, only: [:show] do
member do
put :watching
patch :next_post
put :skip_vote
delete :skip_vote, action: :unskip_vote
get :post_selection_weights
end
resources :comments, controller: :theatre_comments, only: [:index, :create, :destroy]
resources :programmes, controller: :theatre_programmes, only: [:index]
resources :skip_events, controller: :theatre_skip_events, only: [:index]
end
resources :materials, only: [:index, :show, :create, :update, :destroy]
end