public
Description: PLEASE CHECK http://github.com/lifo/docrails/wikis
Homepage: http://weblog.rubyonrails.org/2008/5/2/help-improve-rails-documentation-on-git-branch
Clone URL: git://github.com/lifo/docrails.git
Search Repo:
minor revision in url_for docs

Made explicit that RESTful and controller/action styles are not 
interchangeable, and revised some markup.
fxn (author)
Thu May 15 15:43:03 -0700 2008
commit  4e2bc02163aa646ab1304b1b5bec98a7af8927f5
tree    148cd3f0dbc1d0731a0841a446ba2d8b7c67a4ca
parent  879493c35fd8d9e12e5cf3e56cd67ff07c3345c5
...
120
121
122
123
124
125
 
 
 
126
127
128
129
...
132
133
134
135
 
136
137
 
138
139
140
...
162
163
164
165
 
166
167
168
...
173
174
175
176
 
177
178
179
...
120
121
122
 
 
 
123
124
125
126
127
128
129
...
132
133
134
 
135
136
 
137
138
139
140
...
162
163
164
 
165
166
167
168
...
173
174
175
 
176
177
178
179
0
@@ -120,9 +120,9 @@
0
       # exception.
0
       #
0
       # ==== Examples
0
- # Because it relies on url_for, link_to supports both older-style controller/action/id arguments
0
- # and newer RESTful routes. Current Rails style favors
0
- # RESTful routes whenever possible, so use
0
+ # Because it relies on +url_for+, +link_to+ supports both older-style controller/action/id arguments
0
+ # and newer RESTful routes. Current Rails style favors RESTful routes whenever possible, so base
0
+ # your application on resources and use
0
       #
0
       # link_to "Profile", profile_path(@profile)
0
       # # => <a href="/profiles/1">Profile</a>
0
0
@@ -132,9 +132,9 @@
0
       # link_to "Profile", @profile
0
       # # => <a href="/profiles/1">Profile</a>
0
       #
0
- # in place of the more verbose
0
+ # in place of the older more verbose, non-resource-oriented
0
       #
0
- # link_to "Profile", :controller => "profiles", :action => "show", :id => @profile.id
0
+ # link_to "Profile", :controller => "profiles", :action => "show", :id => @profile
0
       # # => <a href="/profiles/show/1">Profile</a>
0
       #
0
       # Similarly,
0
@@ -162,7 +162,7 @@
0
       # link_to "WRONG!", :controller => "articles", :id => "news", :class => "article"
0
       # # => <a href="/articles/index/news?class=article">WRONG!</a>
0
       #
0
- # link_to can also produce links with anchors or query strings:
0
+ # +link_to+ can also produce links with anchors or query strings:
0
       #
0
       # link_to "Comment wall", profile_path(@profile, :anchor => "wall")
0
       # # => <a href="/profiles/1#wall">Comment wall</a>
0
@@ -173,7 +173,7 @@
0
       # link_to "Nonsense search", searches_path(:foo => "bar", :baz => "quux")
0
       # # => <a href="/searches?foo=bar&amp;baz=quux">Nonsense search</a>
0
       #
0
- # The three options specfic to link_to (<tt>confirm</tt>, <tt>popup</tt>, and <tt>method</tt>) are used as follows:
0
+ # The three options specfic to +link_to+ (<tt>:confirm</tt>, <tt>:popup</tt>, and <tt>:method</tt>) are used as follows:
0
       #
0
       # link_to "Visit Other Site", "http://www.rubyonrails.org/", :confirm => "Are you sure?"
0
       # # => <a href="http://www.rubyonrails.org/" onclick="return confirm('Are you sure?');">Visit Other Site</a>

Comments

    No one has commented yet.