described_routes 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +15 -14
- data/lib/described_routes/rails_controller.rb +1 -1
- data/lib/described_routes.rb +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -71,6 +71,7 @@ You (or your client application) can now browse to any of the following top leve
|
|
71
71
|
* .../described_routes.xml
|
72
72
|
* .../described_routes.yaml
|
73
73
|
* .../described_routes.yaml?short=true
|
74
|
+
* .../described_routes.ytxt
|
74
75
|
|
75
76
|
and for the named route "users" (say):
|
76
77
|
|
@@ -78,25 +79,25 @@ and for the named route "users" (say):
|
|
78
79
|
* .../described_routes/users.xml
|
79
80
|
* .../described_routes/users.yaml
|
80
81
|
* .../described_routes/users.yaml?short=true
|
82
|
+
* .../described_routes/users.txt
|
81
83
|
|
82
84
|
If the application has a route named "root", run-time-generated data will include uri_template attributes based on root_url in addition to the path_template attributes supported at build time.
|
83
85
|
|
84
86
|
Example:
|
85
87
|
|
86
|
-
$ curl http://localhost:3000/described_routes.txt
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
pages pages GET, POST http://localhost:3000/pages{-prefix|.|format}
|
88
|
+
$ curl http://localhost:3000/described_routes/users.txt
|
89
|
+
users users GET, POST http://localhost:3000/users{-prefix|.|format}
|
90
|
+
new_user new_user GET http://localhost:3000/users/new{-prefix|.|format}
|
91
|
+
{user_id} user GET, PUT, DELETE http://localhost:3000/users/{user_id}{-prefix|.|format}
|
92
|
+
edit edit_user GET http://localhost:3000/users/{user_id}/edit{-prefix|.|format}
|
93
|
+
articles user_articles GET, POST http://localhost:3000/users/{user_id}/articles{-prefix|.|format}
|
94
|
+
new_user_article new_user_article GET http://localhost:3000/users/{user_id}/articles/new{-prefix|.|format}
|
95
|
+
recent recent_user_articles GET http://localhost:3000/users/{user_id}/articles/recent{-prefix|.|format}
|
96
|
+
{article_id} user_article GET, PUT, DELETE http://localhost:3000/users/{user_id}/articles/{article_id}{-prefix|.|format}
|
97
|
+
edit edit_user_article GET http://localhost:3000/users/{user_id}/articles/{article_id}/edit{-prefix|.|format}
|
98
|
+
profile user_profile GET, PUT, DELETE, POST http://localhost:3000/users/{user_id}/profile{-prefix|.|format}
|
99
|
+
edit edit_user_profile GET http://localhost:3000/users/{user_id}/profile/edit{-prefix|.|format}
|
100
|
+
new new_user_profile GET http://localhost:3000/users/{user_id}/profile/new{-prefix|.|format}
|
100
101
|
|
101
102
|
== DATA STRUCTURES and FORMATS
|
102
103
|
|
@@ -32,7 +32,7 @@ module DescribedRoutes
|
|
32
32
|
respond_to do |format|
|
33
33
|
format.html # show.html.erb
|
34
34
|
format.json { render :json => resource_template.to_json }
|
35
|
-
format.text { render :text =>
|
35
|
+
format.text { render :text => ResourceTemplate.to_text([resource_template]) }
|
36
36
|
format.xml do
|
37
37
|
render :xml => resource_template.to_xml(Builder::XmlMarkup.new(:indent => 2)).target!
|
38
38
|
end
|
data/lib/described_routes.rb
CHANGED