diff options
Diffstat (limited to 'railties/doc')
-rw-r--r-- | railties/doc/guides/html/getting_started_with_rails.html | 366 | ||||
-rw-r--r-- | railties/doc/guides/html/routing_outside_in.html | 1011 | ||||
-rw-r--r-- | railties/doc/guides/source/getting_started_with_rails.txt | 72 | ||||
-rw-r--r-- | railties/doc/guides/source/routing_outside_in.txt | 113 |
4 files changed, 528 insertions, 1034 deletions
diff --git a/railties/doc/guides/html/getting_started_with_rails.html b/railties/doc/guides/html/getting_started_with_rails.html index f0b30e6218..dcf112ef6d 100644 --- a/railties/doc/guides/html/getting_started_with_rails.html +++ b/railties/doc/guides/html/getting_started_with_rails.html @@ -572,125 +572,70 @@ http://www.gnu.org/software/src-highlite --> <div class="paragraph"><p>In any case, Rails will create a folder in your working directory called <tt>blog</tt>. Open up that folder and explore its contents. Most of the work in this tutorial will happen in the <tt>app/</tt> folder, but here’s a basic rundown on the function of each folder that Rails creates in a new application by default:</p></div>
<div class="tableblock">
<table rules="all"
-frame="hsides"
+width="100%"
+frame="border"
cellspacing="0" cellpadding="4">
-<col width="137" />
-<col width="1440" />
-<thead>
- <tr>
- <th align="left">
- File/Folder
- </th>
- <th align="left">
- Purpose
- </th>
- </tr>
+<col width="50%" />
+<col width="50%" />
+<thead valign="top">
+<tr>
+<th align="left">File/Folder </th>
+<th align="left">Purpose</th>
+</tr>
</thead>
<tbody valign="top">
- <tr>
- <td align="left">
- <tt>README</tt>
- </td>
- <td align="left">
- This is a brief instruction manual for your application. Use it to tell others what your application does, how to set it up, and so on.
- </td>
- </tr>
- <tr>
- <td align="left">
- <tt>Rakefile</tt>
- </td>
- <td align="left">
- This file contains batch jobs that can be run from the terminal.
- </td>
- </tr>
- <tr>
- <td align="left">
- <tt>app/</tt>
- </td>
- <td align="left">
- Contains the controllers, models, and views for your application. You’ll focus on this folder for the remainder of this guide.
- </td>
- </tr>
- <tr>
- <td align="left">
- <tt>config/</tt>
- </td>
- <td align="left">
- Configure your application’s runtime rules, routes, database, and more.
- </td>
- </tr>
- <tr>
- <td align="left">
- <tt>db/</tt>
- </td>
- <td align="left">
- Shows your current database schema, as well as the database migrations. You’ll learn about migrations shortly.
- </td>
- </tr>
- <tr>
- <td align="left">
- <tt>doc/</tt>
- </td>
- <td align="left">
- In-depth documentation for your application.
- </td>
- </tr>
- <tr>
- <td align="left">
- <tt>lib/</tt>
- </td>
- <td align="left">
- Extended modules for your application (not covered in this guide).
- </td>
- </tr>
- <tr>
- <td align="left">
- <tt>log/</tt>
- </td>
- <td align="left">
- Application log files.
- </td>
- </tr>
- <tr>
- <td align="left">
- <tt>public/</tt>
- </td>
- <td align="left">
- The only folder seen to the world as-is. This is where your images, javascript, stylesheets (CSS), and other static files go.
- </td>
- </tr>
- <tr>
- <td align="left">
- <tt>script/</tt>
- </td>
- <td align="left">
- Scripts provided by Rails to do recurring tasks, such as benchmarking, plugin installation, and starting the console or the web server.
- </td>
- </tr>
- <tr>
- <td align="left">
- <tt>test/</tt>
- </td>
- <td align="left">
- Unit tests, fixtures, and other test apparatus. These are covered in <a href="../testing_rails_applications.html">Testing Rails Applications</a>
- </td>
- </tr>
- <tr>
- <td align="left">
- <tt>tmp/</tt>
- </td>
- <td align="left">
- Temporary files
- </td>
- </tr>
- <tr>
- <td align="left">
- <tt>vendor/</tt>
- </td>
- <td align="left">
- A place for third-party code. In a typical Rails application, this includes Ruby Gems, the Rails source code (if you install it into your project) and plugins containing additional prepackaged functionality.
- </td>
- </tr>
+<tr>
+<td align="left"><p class="table"><tt>README</tt></p></td>
+<td align="left"><p class="table">This is a brief instruction manual for your application. Use it to tell others what your application does, how to set it up, and so on.</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table"><tt>Rakefile</tt></p></td>
+<td align="left"><p class="table">This file contains batch jobs that can be run from the terminal.</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table"><tt>app/</tt></p></td>
+<td align="left"><p class="table">Contains the controllers, models, and views for your application. You’ll focus on this folder for the remainder of this guide.</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table"><tt>config/</tt></p></td>
+<td align="left"><p class="table">Configure your application’s runtime rules, routes, database, and more.</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table"><tt>db/</tt></p></td>
+<td align="left"><p class="table">Shows your current database schema, as well as the database migrations. You’ll learn about migrations shortly.</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table"><tt>doc/</tt></p></td>
+<td align="left"><p class="table">In-depth documentation for your application.</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table"><tt>lib/</tt></p></td>
+<td align="left"><p class="table">Extended modules for your application (not covered in this guide).</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table"><tt>log/</tt></p></td>
+<td align="left"><p class="table">Application log files.</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table"><tt>public/</tt></p></td>
+<td align="left"><p class="table">The only folder seen to the world as-is. This is where your images, javascript, stylesheets (CSS), and other static files go.</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table"><tt>script/</tt></p></td>
+<td align="left"><p class="table">Scripts provided by Rails to do recurring tasks, such as benchmarking, plugin installation, and starting the console or the web server.</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table"><tt>test/</tt></p></td>
+<td align="left"><p class="table">Unit tests, fixtures, and other test apparatus. These are covered in <a href="../testing_rails_applications.html">Testing Rails Applications</a></p></td>
+</tr>
+<tr>
+<td align="left"><p class="table"><tt>tmp/</tt></p></td>
+<td align="left"><p class="table">Temporary files</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table"><tt>vendor/</tt></p></td>
+<td align="left"><p class="table">A place for third-party code. In a typical Rails application, this includes Ruby Gems, the Rails source code (if you install it into your project) and plugins containing additional prepackaged functionality.</p></td>
+</tr>
</tbody>
</table>
</div>
@@ -876,133 +821,74 @@ http://www.gnu.org/software/src-highlite --> <div class="paragraph"><p>The scaffold generator will build 13 files in your application, along with some folders, and edit one more. Here’s a quick overview of what it creates:</p></div>
<div class="tableblock">
<table rules="all"
-frame="hsides"
+width="100%"
+frame="border"
cellspacing="0" cellpadding="4">
-<col width="525" />
-<col width="1062" />
-<thead>
- <tr>
- <th align="left">
- File
- </th>
- <th align="left">
- Purpose
- </th>
- </tr>
+<col width="50%" />
+<col width="50%" />
+<thead valign="top">
+<tr>
+<th align="left">File </th>
+<th align="left">Purpose</th>
+</tr>
</thead>
<tbody valign="top">
- <tr>
- <td align="left">
- app/models/post.rb
- </td>
- <td align="left">
- The Post model
- </td>
- </tr>
- <tr>
- <td align="left">
- db/migrate/20081013124235_create_posts.rb
- </td>
- <td align="left">
- Migration to create the posts table in your database (your name will include a different timestamp)
- </td>
- </tr>
- <tr>
- <td align="left">
- app/views/posts/index.html.erb
- </td>
- <td align="left">
- A view to display an index of all posts
- </td>
- </tr>
- <tr>
- <td align="left">
- app/views/posts/show.html.erb
- </td>
- <td align="left">
- A view to display a single post
- </td>
- </tr>
- <tr>
- <td align="left">
- app/views/posts/new.html.erb
- </td>
- <td align="left">
- A view to create a new post
- </td>
- </tr>
- <tr>
- <td align="left">
- app/views/posts/edit.html.erb
- </td>
- <td align="left">
- A view to edit an existing post
- </td>
- </tr>
- <tr>
- <td align="left">
- app/views/layouts/posts.html.erb
- </td>
- <td align="left">
- A view to control the overall look and feel of the other posts views
- </td>
- </tr>
- <tr>
- <td align="left">
- public/stylesheets/scaffold.css
- </td>
- <td align="left">
- Cascading style sheet to make the scaffolded views look better
- </td>
- </tr>
- <tr>
- <td align="left">
- app/controllers/posts_controller.rb
- </td>
- <td align="left">
- The Posts controller
- </td>
- </tr>
- <tr>
- <td align="left">
- test/functional/posts_controller_test.rb
- </td>
- <td align="left">
- Functional testing harness for the posts controller
- </td>
- </tr>
- <tr>
- <td align="left">
- app/helpers/posts_helper.rb
- </td>
- <td align="left">
- Helper functions to be used from the posts views
- </td>
- </tr>
- <tr>
- <td align="left">
- config/routes.rb
- </td>
- <td align="left">
- Edited to include routing information for posts
- </td>
- </tr>
- <tr>
- <td align="left">
- test/fixtures/posts.yml
- </td>
- <td align="left">
- Dummy posts for use in testing
- </td>
- </tr>
- <tr>
- <td align="left">
- test/unit/post_test.rb
- </td>
- <td align="left">
- Unit testing harness for the posts model
- </td>
- </tr>
+<tr>
+<td align="left"><p class="table">app/models/post.rb</p></td>
+<td align="left"><p class="table">The Post model</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">db/migrate/20081013124235_create_posts.rb</p></td>
+<td align="left"><p class="table">Migration to create the posts table in your database (your name will include a different timestamp)</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">app/views/posts/index.html.erb</p></td>
+<td align="left"><p class="table">A view to display an index of all posts</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">app/views/posts/show.html.erb</p></td>
+<td align="left"><p class="table">A view to display a single post</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">app/views/posts/new.html.erb</p></td>
+<td align="left"><p class="table">A view to create a new post</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">app/views/posts/edit.html.erb</p></td>
+<td align="left"><p class="table">A view to edit an existing post</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">app/views/layouts/posts.html.erb</p></td>
+<td align="left"><p class="table">A view to control the overall look and feel of the other posts views</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">public/stylesheets/scaffold.css</p></td>
+<td align="left"><p class="table">Cascading style sheet to make the scaffolded views look better</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">app/controllers/posts_controller.rb</p></td>
+<td align="left"><p class="table">The Posts controller</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">test/functional/posts_controller_test.rb</p></td>
+<td align="left"><p class="table">Functional testing harness for the posts controller</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">app/helpers/posts_helper.rb</p></td>
+<td align="left"><p class="table">Helper functions to be used from the posts views</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">config/routes.rb</p></td>
+<td align="left"><p class="table">Edited to include routing information for posts</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">test/fixtures/posts.yml</p></td>
+<td align="left"><p class="table">Dummy posts for use in testing</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">test/unit/post_test.rb</p></td>
+<td align="left"><p class="table">Unit testing harness for the posts model</p></td>
+</tr>
</tbody>
</table>
</div>
diff --git a/railties/doc/guides/html/routing_outside_in.html b/railties/doc/guides/html/routing_outside_in.html index d15d6208f5..0b5ccc1219 100644 --- a/railties/doc/guides/html/routing_outside_in.html +++ b/railties/doc/guides/html/routing_outside_in.html @@ -487,152 +487,73 @@ http://www.gnu.org/software/src-highlite --> <div class="paragraph"><p>creates seven different routes in your application:</p></div>
<div class="tableblock">
<table rules="all"
-frame="hsides"
+width="100%"
+frame="border"
cellspacing="0" cellpadding="4">
-<col width="125" />
-<col width="182" />
-<col width="137" />
-<col width="102" />
-<col width="502" />
-<thead>
- <tr>
- <th align="left">
- HTTP verb
- </th>
- <th align="left">
- URL
- </th>
- <th align="left">
- controller
- </th>
- <th align="left">
- action
- </th>
- <th align="left">
- used for
- </th>
- </tr>
+<col width="20%" />
+<col width="20%" />
+<col width="20%" />
+<col width="20%" />
+<col width="20%" />
+<thead valign="top">
+<tr>
+<th align="left">HTTP verb </th>
+<th align="left">URL </th>
+<th align="left">controller </th>
+<th align="left">action </th>
+<th align="left">used for</th>
+</tr>
</thead>
<tbody valign="top">
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /photos
- </td>
- <td align="left">
- Photos
- </td>
- <td align="left">
- index
- </td>
- <td align="left">
- display a list of all photos
- </td>
- </tr>
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /photos/new
- </td>
- <td align="left">
- Photos
- </td>
- <td align="left">
- new
- </td>
- <td align="left">
- return an HTML form for creating a new photo
- </td>
- </tr>
- <tr>
- <td align="left">
- POST
- </td>
- <td align="left">
- /photos
- </td>
- <td align="left">
- Photos
- </td>
- <td align="left">
- create
- </td>
- <td align="left">
- create a new photo
- </td>
- </tr>
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /photos/1
- </td>
- <td align="left">
- Photos
- </td>
- <td align="left">
- show
- </td>
- <td align="left">
- display a specific photo
- </td>
- </tr>
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /photos/1/edit
- </td>
- <td align="left">
- Photos
- </td>
- <td align="left">
- edit
- </td>
- <td align="left">
- return an HTML form for editing a photo
- </td>
- </tr>
- <tr>
- <td align="left">
- PUT
- </td>
- <td align="left">
- /photos/1
- </td>
- <td align="left">
- Photos
- </td>
- <td align="left">
- update
- </td>
- <td align="left">
- update a specific photo
- </td>
- </tr>
- <tr>
- <td align="left">
- DELETE
- </td>
- <td align="left">
- /photos/1
- </td>
- <td align="left">
- Photos
- </td>
- <td align="left">
- destroy
- </td>
- <td align="left">
- delete a specific photo
- </td>
- </tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/photos</p></td>
+<td align="left"><p class="table">Photos</p></td>
+<td align="left"><p class="table">index</p></td>
+<td align="left"><p class="table">display a list of all photos</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/photos/new</p></td>
+<td align="left"><p class="table">Photos</p></td>
+<td align="left"><p class="table">new</p></td>
+<td align="left"><p class="table">return an HTML form for creating a new photo</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">POST</p></td>
+<td align="left"><p class="table">/photos</p></td>
+<td align="left"><p class="table">Photos</p></td>
+<td align="left"><p class="table">create</p></td>
+<td align="left"><p class="table">create a new photo</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/photos/1</p></td>
+<td align="left"><p class="table">Photos</p></td>
+<td align="left"><p class="table">show</p></td>
+<td align="left"><p class="table">display a specific photo</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/photos/1/edit</p></td>
+<td align="left"><p class="table">Photos</p></td>
+<td align="left"><p class="table">edit</p></td>
+<td align="left"><p class="table">return an HTML form for editing a photo</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">PUT</p></td>
+<td align="left"><p class="table">/photos/1</p></td>
+<td align="left"><p class="table">Photos</p></td>
+<td align="left"><p class="table">update</p></td>
+<td align="left"><p class="table">update a specific photo</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">DELETE</p></td>
+<td align="left"><p class="table">/photos/1</p></td>
+<td align="left"><p class="table">Photos</p></td>
+<td align="left"><p class="table">destroy</p></td>
+<td align="left"><p class="table">delete a specific photo</p></td>
+</tr>
</tbody>
</table>
</div>
@@ -713,135 +634,66 @@ http://www.gnu.org/software/src-highlite --> <div class="paragraph"><p>creates six different routes in your application:</p></div>
<div class="tableblock">
<table rules="all"
-frame="hsides"
+width="100%"
+frame="border"
cellspacing="0" cellpadding="4">
-<col width="125" />
-<col width="182" />
-<col width="137" />
-<col width="102" />
-<col width="502" />
-<thead>
- <tr>
- <th align="left">
- HTTP verb
- </th>
- <th align="left">
- URL
- </th>
- <th align="left">
- controller
- </th>
- <th align="left">
- action
- </th>
- <th align="left">
- used for
- </th>
- </tr>
+<col width="20%" />
+<col width="20%" />
+<col width="20%" />
+<col width="20%" />
+<col width="20%" />
+<thead valign="top">
+<tr>
+<th align="left">HTTP verb </th>
+<th align="left">URL </th>
+<th align="left">controller </th>
+<th align="left">action </th>
+<th align="left">used for</th>
+</tr>
</thead>
<tbody valign="top">
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /geocoder/new
- </td>
- <td align="left">
- Geocoders
- </td>
- <td align="left">
- new
- </td>
- <td align="left">
- return an HTML form for creating the new geocoder
- </td>
- </tr>
- <tr>
- <td align="left">
- POST
- </td>
- <td align="left">
- /geocoder
- </td>
- <td align="left">
- Geocoders
- </td>
- <td align="left">
- create
- </td>
- <td align="left">
- create the new geocoder
- </td>
- </tr>
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /geocoder
- </td>
- <td align="left">
- Geocoders
- </td>
- <td align="left">
- show
- </td>
- <td align="left">
- display the one and only geocoder resource
- </td>
- </tr>
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /geocoder/edit
- </td>
- <td align="left">
- Geocoders
- </td>
- <td align="left">
- edit
- </td>
- <td align="left">
- return an HTML form for editing the geocoder
- </td>
- </tr>
- <tr>
- <td align="left">
- PUT
- </td>
- <td align="left">
- /geocoder
- </td>
- <td align="left">
- Geocoders
- </td>
- <td align="left">
- update
- </td>
- <td align="left">
- update the one and only geocoder resource
- </td>
- </tr>
- <tr>
- <td align="left">
- DELETE
- </td>
- <td align="left">
- /geocoder
- </td>
- <td align="left">
- Geocoders
- </td>
- <td align="left">
- destroy
- </td>
- <td align="left">
- delete the geocoder resource
- </td>
- </tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/geocoder/new</p></td>
+<td align="left"><p class="table">Geocoders</p></td>
+<td align="left"><p class="table">new</p></td>
+<td align="left"><p class="table">return an HTML form for creating the new geocoder</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">POST</p></td>
+<td align="left"><p class="table">/geocoder</p></td>
+<td align="left"><p class="table">Geocoders</p></td>
+<td align="left"><p class="table">create</p></td>
+<td align="left"><p class="table">create the new geocoder</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/geocoder</p></td>
+<td align="left"><p class="table">Geocoders</p></td>
+<td align="left"><p class="table">show</p></td>
+<td align="left"><p class="table">display the one and only geocoder resource</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/geocoder/edit</p></td>
+<td align="left"><p class="table">Geocoders</p></td>
+<td align="left"><p class="table">edit</p></td>
+<td align="left"><p class="table">return an HTML form for editing the geocoder</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">PUT</p></td>
+<td align="left"><p class="table">/geocoder</p></td>
+<td align="left"><p class="table">Geocoders</p></td>
+<td align="left"><p class="table">update</p></td>
+<td align="left"><p class="table">update the one and only geocoder resource</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">DELETE</p></td>
+<td align="left"><p class="table">/geocoder</p></td>
+<td align="left"><p class="table">Geocoders</p></td>
+<td align="left"><p class="table">destroy</p></td>
+<td align="left"><p class="table">delete the geocoder resource</p></td>
+</tr>
</tbody>
</table>
</div>
@@ -937,152 +789,73 @@ http://www.gnu.org/software/src-highlite --> <div class="paragraph"><p>will recognize incoming URLs containing <tt>photo</tt> but route the requests to the Images controller:</p></div>
<div class="tableblock">
<table rules="all"
-frame="hsides"
+width="100%"
+frame="border"
cellspacing="0" cellpadding="4">
-<col width="125" />
-<col width="182" />
-<col width="137" />
-<col width="102" />
-<col width="502" />
-<thead>
- <tr>
- <th align="left">
- HTTP verb
- </th>
- <th align="left">
- URL
- </th>
- <th align="left">
- controller
- </th>
- <th align="left">
- action
- </th>
- <th align="left">
- used for
- </th>
- </tr>
+<col width="20%" />
+<col width="20%" />
+<col width="20%" />
+<col width="20%" />
+<col width="20%" />
+<thead valign="top">
+<tr>
+<th align="left">HTTP verb </th>
+<th align="left">URL </th>
+<th align="left">controller </th>
+<th align="left">action </th>
+<th align="left">used for</th>
+</tr>
</thead>
<tbody valign="top">
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /photos
- </td>
- <td align="left">
- Images
- </td>
- <td align="left">
- index
- </td>
- <td align="left">
- display a list of all images
- </td>
- </tr>
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /photos/new
- </td>
- <td align="left">
- Images
- </td>
- <td align="left">
- new
- </td>
- <td align="left">
- return an HTML form for creating a new image
- </td>
- </tr>
- <tr>
- <td align="left">
- POST
- </td>
- <td align="left">
- /photos
- </td>
- <td align="left">
- Images
- </td>
- <td align="left">
- create
- </td>
- <td align="left">
- create a new image
- </td>
- </tr>
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /photos/1
- </td>
- <td align="left">
- Images
- </td>
- <td align="left">
- show
- </td>
- <td align="left">
- display a specific image
- </td>
- </tr>
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /photos/1/edit
- </td>
- <td align="left">
- Images
- </td>
- <td align="left">
- edit
- </td>
- <td align="left">
- return an HTML form for editing a image
- </td>
- </tr>
- <tr>
- <td align="left">
- PUT
- </td>
- <td align="left">
- /photos/1
- </td>
- <td align="left">
- Images
- </td>
- <td align="left">
- update
- </td>
- <td align="left">
- update a specific image
- </td>
- </tr>
- <tr>
- <td align="left">
- DELETE
- </td>
- <td align="left">
- /photos/1
- </td>
- <td align="left">
- Images
- </td>
- <td align="left">
- destroy
- </td>
- <td align="left">
- delete a specific image
- </td>
- </tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/photos</p></td>
+<td align="left"><p class="table">Images</p></td>
+<td align="left"><p class="table">index</p></td>
+<td align="left"><p class="table">display a list of all images</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/photos/new</p></td>
+<td align="left"><p class="table">Images</p></td>
+<td align="left"><p class="table">new</p></td>
+<td align="left"><p class="table">return an HTML form for creating a new image</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">POST</p></td>
+<td align="left"><p class="table">/photos</p></td>
+<td align="left"><p class="table">Images</p></td>
+<td align="left"><p class="table">create</p></td>
+<td align="left"><p class="table">create a new image</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/photos/1</p></td>
+<td align="left"><p class="table">Images</p></td>
+<td align="left"><p class="table">show</p></td>
+<td align="left"><p class="table">display a specific image</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/photos/1/edit</p></td>
+<td align="left"><p class="table">Images</p></td>
+<td align="left"><p class="table">edit</p></td>
+<td align="left"><p class="table">return an HTML form for editing a image</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">PUT</p></td>
+<td align="left"><p class="table">/photos/1</p></td>
+<td align="left"><p class="table">Images</p></td>
+<td align="left"><p class="table">update</p></td>
+<td align="left"><p class="table">update a specific image</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">DELETE</p></td>
+<td align="left"><p class="table">/photos/1</p></td>
+<td align="left"><p class="table">Images</p></td>
+<td align="left"><p class="table">destroy</p></td>
+<td align="left"><p class="table">delete a specific image</p></td>
+</tr>
</tbody>
</table>
</div>
@@ -1166,152 +939,73 @@ http://www.gnu.org/software/src-highlite --> <div class="paragraph"><p>will recognize incoming URLs containing <tt>image</tt> but route the requests to the Photos controller:</p></div>
<div class="tableblock">
<table rules="all"
-frame="hsides"
+width="100%"
+frame="border"
cellspacing="0" cellpadding="4">
-<col width="125" />
-<col width="182" />
-<col width="137" />
-<col width="102" />
-<col width="502" />
-<thead>
- <tr>
- <th align="left">
- HTTP verb
- </th>
- <th align="left">
- URL
- </th>
- <th align="left">
- controller
- </th>
- <th align="left">
- action
- </th>
- <th align="left">
- used for
- </th>
- </tr>
+<col width="20%" />
+<col width="20%" />
+<col width="20%" />
+<col width="20%" />
+<col width="20%" />
+<thead valign="top">
+<tr>
+<th align="left">HTTP verb </th>
+<th align="left">URL </th>
+<th align="left">controller </th>
+<th align="left">action </th>
+<th align="left">used for</th>
+</tr>
</thead>
<tbody valign="top">
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /images
- </td>
- <td align="left">
- Photos
- </td>
- <td align="left">
- index
- </td>
- <td align="left">
- display a list of all photos
- </td>
- </tr>
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /images/new
- </td>
- <td align="left">
- Photos
- </td>
- <td align="left">
- new
- </td>
- <td align="left">
- return an HTML form for creating a new photo
- </td>
- </tr>
- <tr>
- <td align="left">
- POST
- </td>
- <td align="left">
- /images
- </td>
- <td align="left">
- Photos
- </td>
- <td align="left">
- create
- </td>
- <td align="left">
- create a new photo
- </td>
- </tr>
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /images/1
- </td>
- <td align="left">
- Photos
- </td>
- <td align="left">
- show
- </td>
- <td align="left">
- display a specific photo
- </td>
- </tr>
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /images/1/edit
- </td>
- <td align="left">
- Photos
- </td>
- <td align="left">
- edit
- </td>
- <td align="left">
- return an HTML form for editing a photo
- </td>
- </tr>
- <tr>
- <td align="left">
- PUT
- </td>
- <td align="left">
- /images/1
- </td>
- <td align="left">
- Photos
- </td>
- <td align="left">
- update
- </td>
- <td align="left">
- update a specific photo
- </td>
- </tr>
- <tr>
- <td align="left">
- DELETE
- </td>
- <td align="left">
- /images/1
- </td>
- <td align="left">
- Photos
- </td>
- <td align="left">
- destroy
- </td>
- <td align="left">
- delete a specific photo
- </td>
- </tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/images</p></td>
+<td align="left"><p class="table">Photos</p></td>
+<td align="left"><p class="table">index</p></td>
+<td align="left"><p class="table">display a list of all photos</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/images/new</p></td>
+<td align="left"><p class="table">Photos</p></td>
+<td align="left"><p class="table">new</p></td>
+<td align="left"><p class="table">return an HTML form for creating a new photo</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">POST</p></td>
+<td align="left"><p class="table">/images</p></td>
+<td align="left"><p class="table">Photos</p></td>
+<td align="left"><p class="table">create</p></td>
+<td align="left"><p class="table">create a new photo</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/images/1</p></td>
+<td align="left"><p class="table">Photos</p></td>
+<td align="left"><p class="table">show</p></td>
+<td align="left"><p class="table">display a specific photo</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/images/1/edit</p></td>
+<td align="left"><p class="table">Photos</p></td>
+<td align="left"><p class="table">edit</p></td>
+<td align="left"><p class="table">return an HTML form for editing a photo</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">PUT</p></td>
+<td align="left"><p class="table">/images/1</p></td>
+<td align="left"><p class="table">Photos</p></td>
+<td align="left"><p class="table">update</p></td>
+<td align="left"><p class="table">update a specific photo</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">DELETE</p></td>
+<td align="left"><p class="table">/images/1</p></td>
+<td align="left"><p class="table">Photos</p></td>
+<td align="left"><p class="table">destroy</p></td>
+<td align="left"><p class="table">delete a specific photo</p></td>
+</tr>
</tbody>
</table>
</div>
@@ -1459,152 +1153,73 @@ http://www.gnu.org/software/src-highlite --> <div class="paragraph"><p>In addition to the routes for magazines, this declaration will also create routes for ads, each of which requires the specification of a magazine in the URL:</p></div>
<div class="tableblock">
<table rules="all"
-frame="hsides"
+width="100%"
+frame="border"
cellspacing="0" cellpadding="4">
-<col width="125" />
-<col width="274" />
-<col width="137" />
-<col width="102" />
-<col width="502" />
-<thead>
- <tr>
- <th align="left">
- HTTP verb
- </th>
- <th align="left">
- URL
- </th>
- <th align="left">
- controller
- </th>
- <th align="left">
- action
- </th>
- <th align="left">
- used for
- </th>
- </tr>
+<col width="20%" />
+<col width="20%" />
+<col width="20%" />
+<col width="20%" />
+<col width="20%" />
+<thead valign="top">
+<tr>
+<th align="left">HTTP verb </th>
+<th align="left">URL </th>
+<th align="left">controller </th>
+<th align="left">action </th>
+<th align="left">used for</th>
+</tr>
</thead>
<tbody valign="top">
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /magazines/1/ads
- </td>
- <td align="left">
- Ads
- </td>
- <td align="left">
- index
- </td>
- <td align="left">
- display a list of all ads for a specific magazine
- </td>
- </tr>
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /magazines/1/ads/new
- </td>
- <td align="left">
- Ads
- </td>
- <td align="left">
- new
- </td>
- <td align="left">
- return an HTML form for creating a new ad belonging to a specific magazine
- </td>
- </tr>
- <tr>
- <td align="left">
- POST
- </td>
- <td align="left">
- /magazines/1/ads
- </td>
- <td align="left">
- Ads
- </td>
- <td align="left">
- create
- </td>
- <td align="left">
- create a new ad belonging to a specific magazine
- </td>
- </tr>
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /magazines/1/ads/1
- </td>
- <td align="left">
- Ads
- </td>
- <td align="left">
- show
- </td>
- <td align="left">
- display a specific ad belonging to a specific magazine
- </td>
- </tr>
- <tr>
- <td align="left">
- GET
- </td>
- <td align="left">
- /magazines/1/ads/1/edit
- </td>
- <td align="left">
- Ads
- </td>
- <td align="left">
- edit
- </td>
- <td align="left">
- return an HTML form for editing an ad belonging to a specific magazine
- </td>
- </tr>
- <tr>
- <td align="left">
- PUT
- </td>
- <td align="left">
- /magazines/1/ads/1
- </td>
- <td align="left">
- Ads
- </td>
- <td align="left">
- update
- </td>
- <td align="left">
- update a specific ad belonging to a specific magazine
- </td>
- </tr>
- <tr>
- <td align="left">
- DELETE
- </td>
- <td align="left">
- /magazines/1/ads/1
- </td>
- <td align="left">
- Ads
- </td>
- <td align="left">
- destroy
- </td>
- <td align="left">
- delete a specific ad belonging to a specific magazine
- </td>
- </tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/magazines/1/ads</p></td>
+<td align="left"><p class="table">Ads</p></td>
+<td align="left"><p class="table">index</p></td>
+<td align="left"><p class="table">display a list of all ads for a specific magazine</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/magazines/1/ads/new</p></td>
+<td align="left"><p class="table">Ads</p></td>
+<td align="left"><p class="table">new</p></td>
+<td align="left"><p class="table">return an HTML form for creating a new ad belonging to a specific magazine</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">POST</p></td>
+<td align="left"><p class="table">/magazines/1/ads</p></td>
+<td align="left"><p class="table">Ads</p></td>
+<td align="left"><p class="table">create</p></td>
+<td align="left"><p class="table">create a new ad belonging to a specific magazine</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/magazines/1/ads/1</p></td>
+<td align="left"><p class="table">Ads</p></td>
+<td align="left"><p class="table">show</p></td>
+<td align="left"><p class="table">display a specific ad belonging to a specific magazine</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">GET</p></td>
+<td align="left"><p class="table">/magazines/1/ads/1/edit</p></td>
+<td align="left"><p class="table">Ads</p></td>
+<td align="left"><p class="table">edit</p></td>
+<td align="left"><p class="table">return an HTML form for editing an ad belonging to a specific magazine</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">PUT</p></td>
+<td align="left"><p class="table">/magazines/1/ads/1</p></td>
+<td align="left"><p class="table">Ads</p></td>
+<td align="left"><p class="table">update</p></td>
+<td align="left"><p class="table">update a specific ad belonging to a specific magazine</p></td>
+</tr>
+<tr>
+<td align="left"><p class="table">DELETE</p></td>
+<td align="left"><p class="table">/magazines/1/ads/1</p></td>
+<td align="left"><p class="table">Ads</p></td>
+<td align="left"><p class="table">destroy</p></td>
+<td align="left"><p class="table">delete a specific ad belonging to a specific magazine</p></td>
+</tr>
</tbody>
</table>
</div>
diff --git a/railties/doc/guides/source/getting_started_with_rails.txt b/railties/doc/guides/source/getting_started_with_rails.txt index 58eff9fd3d..7e87c2935e 100644 --- a/railties/doc/guides/source/getting_started_with_rails.txt +++ b/railties/doc/guides/source/getting_started_with_rails.txt @@ -163,24 +163,23 @@ $ cd blog In any case, Rails will create a folder in your working directory called +blog+. Open up that folder and explore its contents. Most of the work in this tutorial will happen in the +app/+ folder, but here's a basic rundown on the function of each folder that Rails creates in a new application by default: -[grid="all"] -`-----------`----------------------------------------------------------------------------------------------------------------------------- -File/Folder Purpose ------------------------------------------------------------------------------------------------------------------------------------------- -+README+ This is a brief instruction manual for your application. Use it to tell others what your application does, how to set it up, and so on. -+Rakefile+ This file contains batch jobs that can be run from the terminal. -+app/+ Contains the controllers, models, and views for your application. You'll focus on this folder for the remainder of this guide. -+config/+ Configure your application's runtime rules, routes, database, and more. -+db/+ Shows your current database schema, as well as the database migrations. You'll learn about migrations shortly. -+doc/+ In-depth documentation for your application. -+lib/+ Extended modules for your application (not covered in this guide). -+log/+ Application log files. -+public/+ The only folder seen to the world as-is. This is where your images, javascript, stylesheets (CSS), and other static files go. -+script/+ Scripts provided by Rails to do recurring tasks, such as benchmarking, plugin installation, and starting the console or the web server. -+test/+ Unit tests, fixtures, and other test apparatus. These are covered in link:../testing_rails_applications.html[Testing Rails Applications] -+tmp/+ Temporary files -+vendor/+ A place for third-party code. In a typical Rails application, this includes Ruby Gems, the Rails source code (if you install it into your project) and plugins containing additional prepackaged functionality. -------------------------------------------------------------------------------------------------------------------------------------------- +[options="header"] +|========================================================================================================== +|File/Folder |Purpose +|+README+ |This is a brief instruction manual for your application. Use it to tell others what your application does, how to set it up, and so on. +|+Rakefile+ |This file contains batch jobs that can be run from the terminal. +|+app/+ |Contains the controllers, models, and views for your application. You'll focus on this folder for the remainder of this guide. +|+config/+ |Configure your application's runtime rules, routes, database, and more. +|+db/+ |Shows your current database schema, as well as the database migrations. You'll learn about migrations shortly. +|+doc/+ |In-depth documentation for your application. +|+lib/+ |Extended modules for your application (not covered in this guide). +|+log/+ |Application log files. +|+public/+ |The only folder seen to the world as-is. This is where your images, javascript, stylesheets (CSS), and other static files go. +|+script/+ |Scripts provided by Rails to do recurring tasks, such as benchmarking, plugin installation, and starting the console or the web server. +|+test/+ |Unit tests, fixtures, and other test apparatus. These are covered in link:../testing_rails_applications.html[Testing Rails Applications] +|+tmp/+ |Temporary files +|+vendor/+ |A place for third-party code. In a typical Rails application, this includes Ruby Gems, the Rails source code (if you install it into your project) and plugins containing additional prepackaged functionality. +|========================================================================================================== === Configuring a Database @@ -339,25 +338,24 @@ NOTE: While scaffolding will get you up and running quickly, the "one size fits The scaffold generator will build 13 files in your application, along with some folders, and edit one more. Here's a quick overview of what it creates: -[grid="all"] -`---------------------------------------------`-------------------------------------------------------------------------------------------- -File Purpose ------------------------------------------------------------------------------------------------------------------------------------------- -app/models/post.rb The Post model -db/migrate/20081013124235_create_posts.rb Migration to create the posts table in your database (your name will include a different timestamp) -app/views/posts/index.html.erb A view to display an index of all posts -app/views/posts/show.html.erb A view to display a single post -app/views/posts/new.html.erb A view to create a new post -app/views/posts/edit.html.erb A view to edit an existing post -app/views/layouts/posts.html.erb A view to control the overall look and feel of the other posts views -public/stylesheets/scaffold.css Cascading style sheet to make the scaffolded views look better -app/controllers/posts_controller.rb The Posts controller -test/functional/posts_controller_test.rb Functional testing harness for the posts controller -app/helpers/posts_helper.rb Helper functions to be used from the posts views -config/routes.rb Edited to include routing information for posts -test/fixtures/posts.yml Dummy posts for use in testing -test/unit/post_test.rb Unit testing harness for the posts model -------------------------------------------------------------------------------------------------------------------------------------------- +[options="header"] +|========================================================================================================== +|File |Purpose +|app/models/post.rb |The Post model +|db/migrate/20081013124235_create_posts.rb |Migration to create the posts table in your database (your name will include a different timestamp) +|app/views/posts/index.html.erb |A view to display an index of all posts +|app/views/posts/show.html.erb |A view to display a single post +|app/views/posts/new.html.erb |A view to create a new post +|app/views/posts/edit.html.erb |A view to edit an existing post +|app/views/layouts/posts.html.erb |A view to control the overall look and feel of the other posts views +|public/stylesheets/scaffold.css |Cascading style sheet to make the scaffolded views look better +|app/controllers/posts_controller.rb |The Posts controller +|test/functional/posts_controller_test.rb |Functional testing harness for the posts controller +|app/helpers/posts_helper.rb |Helper functions to be used from the posts views +|config/routes.rb |Edited to include routing information for posts +|test/fixtures/posts.yml |Dummy posts for use in testing +|test/unit/post_test.rb |Unit testing harness for the posts model +|========================================================================================================== === Running a Migration diff --git a/railties/doc/guides/source/routing_outside_in.txt b/railties/doc/guides/source/routing_outside_in.txt index 3f6c80de5c..235832e4f3 100644 --- a/railties/doc/guides/source/routing_outside_in.txt +++ b/railties/doc/guides/source/routing_outside_in.txt @@ -132,18 +132,17 @@ map.resources :photos creates seven different routes in your application: -[grid="all"] -`----------`---------------`-----------`--------`------------------------------------------- -HTTP verb URL controller action used for --------------------------------------------------------------------------------------------- -GET /photos Photos index display a list of all photos -GET /photos/new Photos new return an HTML form for creating a new photo -POST /photos Photos create create a new photo -GET /photos/1 Photos show display a specific photo -GET /photos/1/edit Photos edit return an HTML form for editing a photo -PUT /photos/1 Photos update update a specific photo -DELETE /photos/1 Photos destroy delete a specific photo --------------------------------------------------------------------------------------------- +[options="header"] +|========================================================================================================== +|HTTP verb |URL |controller |action |used for +|GET |/photos |Photos |index |display a list of all photos +|GET |/photos/new |Photos |new |return an HTML form for creating a new photo +|POST |/photos |Photos |create |create a new photo +|GET |/photos/1 |Photos |show |display a specific photo +|GET |/photos/1/edit |Photos |edit |return an HTML form for editing a photo +|PUT |/photos/1 |Photos |update |update a specific photo +|DELETE |/photos/1 |Photos |destroy |delete a specific photo +|========================================================================================================== For the specific routes (those that reference just a single resource), the identifier for the resource will be available within the corresponding controller action as +params[:id]+. @@ -197,17 +196,16 @@ map.resource :geocoder creates six different routes in your application: -[grid="all"] -`----------`---------------`-----------`--------`------------------------------------------- -HTTP verb URL controller action used for --------------------------------------------------------------------------------------------- -GET /geocoder/new Geocoders new return an HTML form for creating the new geocoder -POST /geocoder Geocoders create create the new geocoder -GET /geocoder Geocoders show display the one and only geocoder resource -GET /geocoder/edit Geocoders edit return an HTML form for editing the geocoder -PUT /geocoder Geocoders update update the one and only geocoder resource -DELETE /geocoder Geocoders destroy delete the geocoder resource --------------------------------------------------------------------------------------------- +[options="header"] +|========================================================================================================== +|HTTP verb |URL |controller |action |used for +|GET |/geocoder/new |Geocoders |new |return an HTML form for creating the new geocoder +|POST |/geocoder |Geocoders |create |create the new geocoder +|GET |/geocoder |Geocoders |show |display the one and only geocoder resource +|GET |/geocoder/edit |Geocoders |edit |return an HTML form for editing the geocoder +|PUT |/geocoder |Geocoders |update |update the one and only geocoder resource +|DELETE |/geocoder |Geocoders |destroy |delete the geocoder resource +|========================================================================================================== NOTE: Even though the name of the resource is singular in +routes.rb+, the matching controller is still plural. @@ -245,18 +243,17 @@ map.resources :photos, :controller => "images" will recognize incoming URLs containing +photo+ but route the requests to the Images controller: -[grid="all"] -`----------`---------------`-----------`--------`------------------------------------------- -HTTP verb URL controller action used for --------------------------------------------------------------------------------------------- -GET /photos Images index display a list of all images -GET /photos/new Images new return an HTML form for creating a new image -POST /photos Images create create a new image -GET /photos/1 Images show display a specific image -GET /photos/1/edit Images edit return an HTML form for editing a image -PUT /photos/1 Images update update a specific image -DELETE /photos/1 Images destroy delete a specific image --------------------------------------------------------------------------------------------- +[options="header"] +|========================================================================================================== +|HTTP verb |URL |controller |action |used for +|GET |/photos |Images |index |display a list of all images +|GET |/photos/new |Images |new |return an HTML form for creating a new image +|POST |/photos |Images |create |create a new image +|GET |/photos/1 |Images |show |display a specific image +|GET |/photos/1/edit |Images |edit |return an HTML form for editing a image +|PUT |/photos/1 |Images |update |update a specific image +|DELETE |/photos/1 |Images |destroy |delete a specific image +|========================================================================================================== NOTE: The helpers will be generated with the name of the resource, not the name of the controller. So in this case, you'd still get +photos_path+, +new_photo_path+, and so on. @@ -328,18 +325,17 @@ map.resources :photos, :as => "images" will recognize incoming URLs containing +image+ but route the requests to the Photos controller: -[grid="all"] -`----------`---------------`-----------`--------`------------------------------------------- -HTTP verb URL controller action used for --------------------------------------------------------------------------------------------- -GET /images Photos index display a list of all photos -GET /images/new Photos new return an HTML form for creating a new photo -POST /images Photos create create a new photo -GET /images/1 Photos show display a specific photo -GET /images/1/edit Photos edit return an HTML form for editing a photo -PUT /images/1 Photos update update a specific photo -DELETE /images/1 Photos destroy delete a specific photo --------------------------------------------------------------------------------------------- +[options="header"] +|========================================================================================================== +|HTTP verb |URL |controller |action |used for +|GET |/images |Photos |index |display a list of all photos +|GET |/images/new |Photos |new |return an HTML form for creating a new photo +|POST |/images |Photos |create |create a new photo +|GET |/images/1 |Photos |show |display a specific photo +|GET |/images/1/edit |Photos |edit |return an HTML form for editing a photo +|PUT |/images/1 |Photos |update |update a specific photo +|DELETE |/images/1 |Photos |destroy |delete a specific photo +|========================================================================================================== NOTE: The helpers will be generated with the name of the resource, not the path name. So in this case, you'd still get +photos_path+, +new_photo_path+, and so on. @@ -452,18 +448,17 @@ end In addition to the routes for magazines, this declaration will also create routes for ads, each of which requires the specification of a magazine in the URL: -[grid="all"] -`----------`-----------------------`-----------`--------`------------------------------------------- -HTTP verb URL controller action used for --------------------------------------------------------------------------------------------- -GET /magazines/1/ads Ads index display a list of all ads for a specific magazine -GET /magazines/1/ads/new Ads new return an HTML form for creating a new ad belonging to a specific magazine -POST /magazines/1/ads Ads create create a new ad belonging to a specific magazine -GET /magazines/1/ads/1 Ads show display a specific ad belonging to a specific magazine -GET /magazines/1/ads/1/edit Ads edit return an HTML form for editing an ad belonging to a specific magazine -PUT /magazines/1/ads/1 Ads update update a specific ad belonging to a specific magazine -DELETE /magazines/1/ads/1 Ads destroy delete a specific ad belonging to a specific magazine --------------------------------------------------------------------------------------------- +[options="header"] +|========================================================================================================== +|HTTP verb |URL |controller |action |used for +|GET |/magazines/1/ads |Ads |index |display a list of all ads for a specific magazine +|GET |/magazines/1/ads/new |Ads |new |return an HTML form for creating a new ad belonging to a specific magazine +|POST |/magazines/1/ads |Ads |create |create a new ad belonging to a specific magazine +|GET |/magazines/1/ads/1 |Ads |show |display a specific ad belonging to a specific magazine +|GET |/magazines/1/ads/1/edit |Ads |edit |return an HTML form for editing an ad belonging to a specific magazine +|PUT |/magazines/1/ads/1 |Ads |update |update a specific ad belonging to a specific magazine +|DELETE |/magazines/1/ads/1 |Ads |destroy |delete a specific ad belonging to a specific magazine +|========================================================================================================== This will also create routing helpers such as +magazine_ads_url+ and +edit_magazine_ad_path+. |