mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
add: home index controllers
This commit is contained in:
6
app/controllers/topic/activity_forums_controller.rb
Normal file
6
app/controllers/topic/activity_forums_controller.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class Topic::ActivityForumsController < Topic::BaseController
|
||||
|
||||
def index
|
||||
@activity_forums = kaminari_paginate(Topic::ActivityForum)
|
||||
end
|
||||
end
|
||||
6
app/controllers/topic/banners_controller.rb
Normal file
6
app/controllers/topic/banners_controller.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class Topic::BannersController < Topic::BaseController
|
||||
|
||||
def index
|
||||
@banners = kaminari_paginate(Topic::Banner)
|
||||
end
|
||||
end
|
||||
3
app/controllers/topic/base_controller.rb
Normal file
3
app/controllers/topic/base_controller.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
class Topic::BaseController < ApplicationController
|
||||
|
||||
end
|
||||
6
app/controllers/topic/cards_controller.rb
Normal file
6
app/controllers/topic/cards_controller.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class Topic::CardsController < Topic::BaseController
|
||||
|
||||
def index
|
||||
@cards = kaminari_paginate(Topic::Card)
|
||||
end
|
||||
end
|
||||
6
app/controllers/topic/cooperators_controller.rb
Normal file
6
app/controllers/topic/cooperators_controller.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class Topic::CooperatorsController < Topic::BaseController
|
||||
|
||||
def index
|
||||
@cooperators = kaminari_paginate(Topic::Cooperator)
|
||||
end
|
||||
end
|
||||
6
app/controllers/topic/excellent_projects_controller.rb
Normal file
6
app/controllers/topic/excellent_projects_controller.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class Topic::ExcellentProjectsController < Topic::BaseController
|
||||
|
||||
def index
|
||||
@excellent_projects = kaminari_paginate(Topic::ExcellentProject)
|
||||
end
|
||||
end
|
||||
6
app/controllers/topic/experience_forums_controller.rb
Normal file
6
app/controllers/topic/experience_forums_controller.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class Topic::ExperienceForumsController < Topic::BaseController
|
||||
|
||||
def index
|
||||
@experience_forums = kaminari_paginate(Topic::ExperienceForum)
|
||||
end
|
||||
end
|
||||
6
app/controllers/topic/pinned_forums_controller.rb
Normal file
6
app/controllers/topic/pinned_forums_controller.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class Topic::PinnedForumsController < Topic::BaseController
|
||||
|
||||
def index
|
||||
@pinned_forums = kaminari_paginate(Topic::PinnedForum)
|
||||
end
|
||||
end
|
||||
@@ -24,6 +24,16 @@ Rails.application.routes.draw do
|
||||
resources :edu_settings
|
||||
|
||||
scope '/api' do
|
||||
namespace :topic do
|
||||
resources :activity_forums, only: [:index]
|
||||
resources :banners, only: [:index]
|
||||
resources :cards, only: [:index]
|
||||
resources :cooperators, only: [:index]
|
||||
resources :excellent_projects, only: [:index]
|
||||
resources :experience_forums, only: [:index]
|
||||
resources :pinned_forums, only: [:index]
|
||||
end
|
||||
|
||||
namespace :ci do
|
||||
resources :languages, only: [:index, :show] do
|
||||
collection do
|
||||
|
||||
Reference in New Issue
Block a user