json API for suseconferenceclient
This commit is contained in:
parent
d648ab7cb5
commit
d95d8f234b
12 changed files with 159 additions and 8 deletions
17
app/serializers/speaker_serializer.rb
Normal file
17
app/serializers/speaker_serializer.rb
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
class SpeakerSerializer < ActiveModel::Serializer
|
||||
include ActionView::Helpers::TextHelper
|
||||
|
||||
attributes :guid, :name, :company, :biography
|
||||
|
||||
def name
|
||||
object.public_name
|
||||
end
|
||||
|
||||
def biography
|
||||
if object.biography.blank?
|
||||
nil
|
||||
else
|
||||
simple_format(object.biography).gsub("\n", "")
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue