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 EventSerializer < ActiveModel::Serializer
|
||||
include ActionView::Helpers::TextHelper
|
||||
include Rails.application.routes.url_helpers
|
||||
|
||||
attributes :guid, :title, :length, :scheduled_date, :language, :abstract, :speaker_ids, :type, :room, :track
|
||||
attributes :guid, :url, :title, :length, :scheduled_date, :language, :abstract, :speaker_ids, :type, :room, :track
|
||||
|
||||
def url
|
||||
conference_program_proposal_url(object.conference.short_title, object.id)
|
||||
end
|
||||
|
||||
def scheduled_date
|
||||
t = object.time
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue