aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/README
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-10-16 15:42:03 +0000
committerJamis Buck <jamis@37signals.com>2005-10-16 15:42:03 +0000
commit1c057b7237c98d948b08b80c0ac403cda3028dab (patch)
tree455dc930b10a4408f4b25fb97c156a6abdb8a755 /actionpack/README
parent59f1df1b5b37a9e16a6b03d931c7b620075034d5 (diff)
downloadrails-1c057b7237c98d948b08b80c0ac403cda3028dab.tar.gz
rails-1c057b7237c98d948b08b80c0ac403cda3028dab.tar.bz2
rails-1c057b7237c98d948b08b80c0ac403cda3028dab.zip
Update/clean up AP documentation (rdoc)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2649 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/README')
-rwxr-xr-xactionpack/README24
1 files changed, 12 insertions, 12 deletions
diff --git a/actionpack/README b/actionpack/README
index 1a2da631b1..c8624bf407 100755
--- a/actionpack/README
+++ b/actionpack/README
@@ -40,14 +40,14 @@ A short rundown of the major features:
def update
@customer = find_customer
- @customer.attributes = @params["customer"]
+ @customer.attributes = params[:customer]
@customer.save ?
redirect_to(:action => "display") :
render(:action => "edit")
end
private
- def find_customer() Customer.find(@params["id"]) end
+ def find_customer() Customer.find(params[:id]) end
end
{Learn more}[link:classes/ActionController/Base.html]
@@ -182,7 +182,7 @@ A short rundown of the major features:
# controller
def list
@pages, @people =
- paginate :people, :order_by => 'last_name, first_name'
+ paginate :people, :order => 'last_name, first_name'
end
# view
@@ -202,8 +202,8 @@ A short rundown of the major features:
end
def test_failing_authenticate
- process :authenticate, "user_name" => "nop", "password" => ""
- assert_flash_has 'alert'
+ process :authenticate, :user_name => "nop", :password => ""
+ assert flash.has_key?(:alert)
assert_redirected_to :action => "index"
end
end
@@ -252,10 +252,10 @@ A short rundown of the major features:
end
def update
- List.update(@params["list"]["id"], @params["list"])
- expire_page :action => "show", :id => @params["list"]["id"]
+ List.update(params[:list][:id], params[:list])
+ expire_page :action => "show", :id => params[:list][:id]
expire_action :action => "account"
- redirect_to :action => "show", :id => @params["list"]["id"]
+ redirect_to :action => "show", :id => params[:list][:id]
end
end
@@ -342,8 +342,8 @@ A short rundown of the major features:
class WeblogController < ActionController::Base
def save
- post = Post.create(@params["post"])
- redirect_to :action => "display", :path_params => { "id" => post.id }
+ post = Post.create(params[:post])
+ redirect_to :action => "display", :id => post.id
end
end
@@ -370,7 +370,7 @@ methods:
end
def display
- @post = Post.find(@params["id"])
+ @post = Post.find(:params[:id])
end
def new
@@ -378,7 +378,7 @@ methods:
end
def create
- @post = Post.create(@params["post"])
+ @post = Post.create(params[:post])
redirect_to :action => "display", :id => @post.id
end
end