aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/api
diff options
context:
space:
mode:
authorMarc Florisson2012-12-05 18:32:07 +0100
committerMarc Florisson2012-12-05 18:32:07 +0100
commitfdd87a8e14d3fcbf0f2fd91d6f2280e0128c73cf (patch)
tree2dfc14269959e49f352fd84233ea88d635926ed8 /app/views/api
parent2570573d472010249b753e404c6cad003a78ad39 (diff)
downloadchouette-core-fdd87a8e14d3fcbf0f2fd91d6f2280e0128c73cf.tar.bz2
add more controllers in api/V1
Diffstat (limited to 'app/views/api')
-rw-r--r--app/views/api/v1/lines/index.rabl4
-rw-r--r--app/views/api/v1/lines/show.json.rabl11
-rw-r--r--app/views/api/v1/lines/show.rabl12
-rw-r--r--app/views/api/v1/lines/show.xml.rabl10
4 files changed, 16 insertions, 21 deletions
diff --git a/app/views/api/v1/lines/index.rabl b/app/views/api/v1/lines/index.rabl
new file mode 100644
index 000000000..6c3f73022
--- /dev/null
+++ b/app/views/api/v1/lines/index.rabl
@@ -0,0 +1,4 @@
+collection @lines
+
+extends "api/v1/lines/show"
+
diff --git a/app/views/api/v1/lines/show.json.rabl b/app/views/api/v1/lines/show.json.rabl
deleted file mode 100644
index f9bf85dbd..000000000
--- a/app/views/api/v1/lines/show.json.rabl
+++ /dev/null
@@ -1,11 +0,0 @@
-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.rabl b/app/views/api/v1/lines/show.rabl
new file mode 100644
index 000000000..1d65325cb
--- /dev/null
+++ b/app/views/api/v1/lines/show.rabl
@@ -0,0 +1,12 @@
+object @line
+attributes :objectid, :object_version, :creation_time, :creator_id
+attributes :name, :number, :published_name, :transport_mode_name
+attributes :registration_number, :comment, :mobility_restricted_suitability, :int_user_needs
+
+child :network do
+ attributes :objectid, :name, :description, :registration_number
+end
+
+child :company do
+ attributes :objectid, :name, :short_name, :registration_number
+end
diff --git a/app/views/api/v1/lines/show.xml.rabl b/app/views/api/v1/lines/show.xml.rabl
deleted file mode 100644
index e1e165d30..000000000
--- a/app/views/api/v1/lines/show.xml.rabl
+++ /dev/null
@@ -1,10 +0,0 @@
-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
-