mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 10:17:19 +08:00
Add /badges route that lists all defined badges.
This commit is contained in:
@ -1,9 +1,4 @@
|
||||
class Admin::BadgesController < Admin::AdminController
|
||||
def index
|
||||
badges = Badge.all.to_a
|
||||
render_serialized(badges, BadgeSerializer, root: "badges")
|
||||
end
|
||||
|
||||
def badge_types
|
||||
badge_types = BadgeType.all.to_a
|
||||
render_serialized(badge_types, BadgeTypeSerializer, root: "badge_types")
|
||||
|
6
app/controllers/badges_controller.rb
Normal file
6
app/controllers/badges_controller.rb
Normal file
@ -0,0 +1,6 @@
|
||||
class BadgesController < ApplicationController
|
||||
def index
|
||||
badges = Badge.all.to_a
|
||||
render_serialized(badges, BadgeSerializer, root: "badges")
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user