Add URLs to API responses

Resolves inability of API consumers to provide links to OSEM.
This commit is contained in:
Andrew Kvalheim 2022-10-27 12:57:42 -07:00
parent 5b89f64eaf
commit e01fd2d721
6 changed files with 27 additions and 3 deletions

View file

@ -2,8 +2,13 @@
class SpeakerSerializer < ActiveModel::Serializer
include ActionView::Helpers::TextHelper
include Rails.application.routes.url_helpers
attributes :name, :affiliation, :biography
attributes :url, :name, :affiliation, :biography
delegate :name, to: :object
def url
url_for(object)
end
end