mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Update various documentation examples to use new routing DSL
This commit is contained in:
@@ -6,7 +6,7 @@ module ActionController
|
||||
# the view actions to a higher logical level. Example:
|
||||
#
|
||||
# # routes
|
||||
# map.resources :posts
|
||||
# resources :posts
|
||||
#
|
||||
# # view
|
||||
# <% div_for(post) do %> <div id="post_45" class="post">
|
||||
|
||||
@@ -63,7 +63,7 @@ module ActionDispatch
|
||||
# named routes. For example, suppose that you have a 'users' resource in your
|
||||
# <b>routes.rb</b>:
|
||||
#
|
||||
# map.resources :users
|
||||
# resources :users
|
||||
#
|
||||
# This generates, among other things, the method <tt>users_path</tt>. By default,
|
||||
# this method is accessible from your controllers, views and mailers. If you need
|
||||
|
||||
@@ -9,8 +9,8 @@ module ActionView
|
||||
#
|
||||
# config/routes.rb:
|
||||
# Basecamp::Application.routes.draw do |map|
|
||||
# map.resources :posts
|
||||
# map.root :controller => "posts"
|
||||
# resources :posts
|
||||
# root :to => "posts#index"
|
||||
# end
|
||||
#
|
||||
# app/controllers/posts_controller.rb:
|
||||
|
||||
@@ -1572,7 +1572,7 @@ module ActiveRecord #:nodoc:
|
||||
# or nil if this record's unsaved.
|
||||
#
|
||||
# For example, suppose that you have a User model, and that you have a
|
||||
# <tt>map.resources :users</tt> route. Normally, +user_path+ will
|
||||
# <tt>resources :users</tt> route. Normally, +user_path+ will
|
||||
# construct a path with the user object's 'id' in it:
|
||||
#
|
||||
# user = User.find_by_name('Phusion')
|
||||
|
||||
Reference in New Issue
Block a user