diff --git a/app/controllers/topic/activity_forums_controller.rb b/app/controllers/topic/activity_forums_controller.rb new file mode 100644 index 000000000..e1b6f3fa6 --- /dev/null +++ b/app/controllers/topic/activity_forums_controller.rb @@ -0,0 +1,6 @@ +class Topic::ActivityForumsController < Topic::BaseController + + def index + @activity_forums = kaminari_paginate(Topic::ActivityForum) + end +end \ No newline at end of file diff --git a/app/controllers/topic/banners_controller.rb b/app/controllers/topic/banners_controller.rb new file mode 100644 index 000000000..9843ad202 --- /dev/null +++ b/app/controllers/topic/banners_controller.rb @@ -0,0 +1,6 @@ +class Topic::BannersController < Topic::BaseController + + def index + @banners = kaminari_paginate(Topic::Banner) + end +end \ No newline at end of file diff --git a/app/controllers/topic/base_controller.rb b/app/controllers/topic/base_controller.rb new file mode 100644 index 000000000..0654a7e95 --- /dev/null +++ b/app/controllers/topic/base_controller.rb @@ -0,0 +1,3 @@ +class Topic::BaseController < ApplicationController + +end \ No newline at end of file diff --git a/app/controllers/topic/cards_controller.rb b/app/controllers/topic/cards_controller.rb new file mode 100644 index 000000000..a61031bf7 --- /dev/null +++ b/app/controllers/topic/cards_controller.rb @@ -0,0 +1,6 @@ +class Topic::CardsController < Topic::BaseController + + def index + @cards = kaminari_paginate(Topic::Card) + end +end \ No newline at end of file diff --git a/app/controllers/topic/cooperators_controller.rb b/app/controllers/topic/cooperators_controller.rb new file mode 100644 index 000000000..c1f4ad60b --- /dev/null +++ b/app/controllers/topic/cooperators_controller.rb @@ -0,0 +1,6 @@ +class Topic::CooperatorsController < Topic::BaseController + + def index + @cooperators = kaminari_paginate(Topic::Cooperator) + end +end \ No newline at end of file diff --git a/app/controllers/topic/excellent_projects_controller.rb b/app/controllers/topic/excellent_projects_controller.rb new file mode 100644 index 000000000..fb57b0541 --- /dev/null +++ b/app/controllers/topic/excellent_projects_controller.rb @@ -0,0 +1,6 @@ +class Topic::ExcellentProjectsController < Topic::BaseController + + def index + @excellent_projects = kaminari_paginate(Topic::ExcellentProject) + end +end \ No newline at end of file diff --git a/app/controllers/topic/experience_forums_controller.rb b/app/controllers/topic/experience_forums_controller.rb new file mode 100644 index 000000000..43a555a94 --- /dev/null +++ b/app/controllers/topic/experience_forums_controller.rb @@ -0,0 +1,6 @@ +class Topic::ExperienceForumsController < Topic::BaseController + + def index + @experience_forums = kaminari_paginate(Topic::ExperienceForum) + end +end \ No newline at end of file diff --git a/app/controllers/topic/pinned_forums_controller.rb b/app/controllers/topic/pinned_forums_controller.rb new file mode 100644 index 000000000..9717058e7 --- /dev/null +++ b/app/controllers/topic/pinned_forums_controller.rb @@ -0,0 +1,6 @@ +class Topic::PinnedForumsController < Topic::BaseController + + def index + @pinned_forums = kaminari_paginate(Topic::PinnedForum) + end +end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 5d40ca42c..8ea18375e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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