docbrown/app/views/response_templates/index.json.jbuilder
Joshua Wehner 07e1364f54
Trusted users can view & use moderator response templates (#17867)
* Trusted users can use moderator response templates

* Iron out container reveal logic

* Explanatory comment on controller endpoint confusion
2022-06-16 14:05:49 +02:00

11 lines
267 B
Ruby

attrs = %i[id type_of user_id title content]
if @response_templates.is_a?(Array)
json.array!(@response_templates, *attrs)
else
@response_templates.each_pair do |type_of, templates|
json.set!(type_of) do
json.array!(templates, *attrs)
end
end
end