discourse/app/controllers/badges_controller.rb

13 lines
299 B
Ruby
Raw Normal View History

class BadgesController < ApplicationController
def index
badges = Badge.all.to_a
render_serialized(badges, BadgeSerializer, root: "badges")
end
2014-04-16 09:56:11 -05:00
def show
params.require(:id)
badge = Badge.find(params[:id])
render_serialized(badge, BadgeSerializer, root: "badge")
end
end