aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/api
diff options
context:
space:
mode:
authorMarc Florisson2012-11-30 10:04:01 +0100
committerMarc Florisson2012-11-30 10:04:01 +0100
commita0bd6fc318e7ebe75e8c03949b9fc61e581de943 (patch)
tree1c465d9653b9abe4e1dba0378f468357f63f49f2 /app/views/api
parenta018c33f2792033e5c0829252775f9831950b3ae (diff)
downloadchouette-core-a0bd6fc318e7ebe75e8c03949b9fc61e581de943.tar.bz2
add gem rabl
Diffstat (limited to 'app/views/api')
-rw-r--r--app/views/api/v1/lines/show.json.rabl11
-rw-r--r--app/views/api/v1/lines/show.xml.rabl10
2 files changed, 21 insertions, 0 deletions
diff --git a/app/views/api/v1/lines/show.json.rabl b/app/views/api/v1/lines/show.json.rabl
new file mode 100644
index 000000000..f9bf85dbd
--- /dev/null
+++ b/app/views/api/v1/lines/show.json.rabl
@@ -0,0 +1,11 @@
+object @line
+attributes :objectid, :creation_time, :creator_id, :name, :number, :published_name, :transport_mode_name
+attributes :registration_number, :comment, :mobility_restricted_suitability, :int_user_needs
+
+child :network do
+ attributes :id, :name
+ node(:aa) { |network| titi }
+ node(:url) { |network| api_v1_network_url(:id => network.objectid) }
+end
+
+ # attr_accessible :transport_mode, :network_id, :company_id, :objectid, :object_version
diff --git a/app/views/api/v1/lines/show.xml.rabl b/app/views/api/v1/lines/show.xml.rabl
new file mode 100644
index 000000000..e1e165d30
--- /dev/null
+++ b/app/views/api/v1/lines/show.xml.rabl
@@ -0,0 +1,10 @@
+object @line
+attributes :objectid, :creation_time, :creator_id, :name, :number, :published_name, :transport_mode_name
+attributes :registration_number, :comment, :mobility_restricted_suitability, :int_user_needs
+
+child :network do
+ attributes :id, :name
+ node(:aa) { |network| titi }
+ node(:url) { |network| api_v1_network_url(:id => network.objectid) }
+end
+