Switch to using jbuilder for JSON templates
This commit is contained in:
parent
6852bc9c92
commit
b5d4c262dd
8 changed files with 10 additions and 14 deletions
|
@ -2,7 +2,7 @@ json.type "Feature"
|
|||
|
||||
json.geometry do
|
||||
json.type "Point"
|
||||
json.coordinates [ note.lon.to_f, note.lat.to_f ]
|
||||
json.coordinates [note.lon.to_f, note.lat.to_f]
|
||||
end
|
||||
|
||||
json.properties do
|
||||
|
@ -16,12 +16,12 @@ json.properties do
|
|||
json.close_url close_note_url(note, :format => params[:format])
|
||||
end
|
||||
|
||||
json.date_created note.created_at
|
||||
json.date_created note.created_at.to_s
|
||||
json.status note.status
|
||||
json.closed_at note.closed_at if note.closed?
|
||||
json.closed_at note.closed_at.to_s if note.closed?
|
||||
|
||||
json.comments(note.comments) do |comment|
|
||||
json.date comment.created_at
|
||||
json.date comment.created_at.to_s
|
||||
|
||||
if comment.author
|
||||
json.uid comment.author.id
|
|
@ -1,5 +1,5 @@
|
|||
json.type "FeatureCollection"
|
||||
|
||||
json.features(@notes) do |note|
|
||||
json.ingest! render(note)
|
||||
json.partial! note
|
||||
end
|
1
app/views/api/notes/show.json.jbuilder
Normal file
1
app/views/api/notes/show.json.jbuilder
Normal file
|
@ -0,0 +1 @@
|
|||
json.partial! @note
|
|
@ -1 +0,0 @@
|
|||
json.ingest! render(@note)
|
Loading…
Add table
Add a link
Reference in a new issue