add: home index controllers

This commit is contained in:
yystopf 2021-11-02 15:59:57 +08:00
parent 94075717e2
commit 385f45ddde
9 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,6 @@
class Topic::ActivityForumsController < Topic::BaseController
def index
@activity_forums = kaminari_paginate(Topic::ActivityForum)
end
end

View File

@ -0,0 +1,6 @@
class Topic::BannersController < Topic::BaseController
def index
@banners = kaminari_paginate(Topic::Banner)
end
end

View File

@ -0,0 +1,3 @@
class Topic::BaseController < ApplicationController
end

View File

@ -0,0 +1,6 @@
class Topic::CardsController < Topic::BaseController
def index
@cards = kaminari_paginate(Topic::Card)
end
end

View File

@ -0,0 +1,6 @@
class Topic::CooperatorsController < Topic::BaseController
def index
@cooperators = kaminari_paginate(Topic::Cooperator)
end
end

View File

@ -0,0 +1,6 @@
class Topic::ExcellentProjectsController < Topic::BaseController
def index
@excellent_projects = kaminari_paginate(Topic::ExcellentProject)
end
end

View File

@ -0,0 +1,6 @@
class Topic::ExperienceForumsController < Topic::BaseController
def index
@experience_forums = kaminari_paginate(Topic::ExperienceForum)
end
end

View File

@ -0,0 +1,6 @@
class Topic::PinnedForumsController < Topic::BaseController
def index
@pinned_forums = kaminari_paginate(Topic::PinnedForum)
end
end

View File

@ -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