gem 'open_id_authentication', '>= 1.1.0'
gem 'validates_email_format_of', '>= 1.5.1'
gem 'composite_primary_keys', '>= 4.1.1'
+gem 'jsonify-rails'
# Load libxml support for XML parsing and generation
gem 'libxml-ruby', '>= 2.0.5', :require => 'libxml'
railties (~> 3.0)
thor (~> 0.14)
json (1.6.1)
+ jsonify (0.2.0)
+ jsonify-rails (0.2.0)
+ actionpack
+ jsonify (>= 0.2.0)
libv8 (3.3.10.4)
libxml-ruby (2.2.2)
mail (2.3.0)
dynamic_form
httpclient
jquery-rails
+ jsonify-rails
libxml-ruby (>= 2.0.5)
memcache-client
memcached
+++ /dev/null
-{
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [ <%= note.lon %>, <%= note.lat %> ]
- },
- "properties": {
- "id": <%= note.id %>,
- "date_created": "<%= note.created_at %>",
- "nearby": "<%= note.nearby_place %>",
- "status": "<%= note.status %>",
-<% if note.status == "closed" -%>
- "closed_at": "<%= note.closed_at %>",
-<% end -%>
- "comments": [
- <%= render :partial => "note_comment", :collection => note.comments, :spacer_template => "note_spacer" -%>
- ]
- }
-}
--- /dev/null
+json.type "Feature"
+
+json.geometry do
+ json.type "Point"
+ json.coordinates [ note.lon, note.lat ]
+end
+
+json.properties do
+ json.id note.id
+ json.date_created note.created_at
+ json.nearby note.nearby_place
+ json.status note.status
+ json.closed_at note.closed_at if note.status == "closed"
+
+ json.comments(note.comments) do |comment|
+ json.date comment.created_at
+ json.uid comment.author_id unless comment.author_id.nil?
+ json.user comment.author_name
+ json.text comment.body
+ end
+end
+++ /dev/null
-{
- "date": "<%= note_comment.created_at %>",
-<% unless note_comment.author_id.nil? -%>
- "uid": <%= note_comment.author_id %>,
-<% end -%>
- "user": "<%= note_comment.author_name %>",
- "text": "<%= note_comment.body %>"
-}
+++ /dev/null
-{
- "type": "FeatureCollection",
- "features": [
- <%= render :partial => "note", :collection => @notes, :spacer_template=> "note_spacer" -%>
- ]
-}
--- /dev/null
+json.type "FeatureCollection"
+
+json.features(@notes) do |note|
+ json.ingest! render(:partial => "note", :object => note)
+end
--- /dev/null
+json.ingest! render(:partial => "note", :object => @note)