mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-18 22:21:11 +00:00
Add URLs to API responses
Resolves inability of API consumers to provide links to OSEM.
This commit is contained in:
parent
5b89f64eaf
commit
e01fd2d721
6 changed files with 27 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue