aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/examples
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/examples')
-rw-r--r--actionpack/examples/address_book_controller.rb6
-rwxr-xr-xactionpack/examples/blog_controller.cgi2
-rwxr-xr-xactionpack/examples/debate_controller.cgi10
3 files changed, 9 insertions, 9 deletions
diff --git a/actionpack/examples/address_book_controller.rb b/actionpack/examples/address_book_controller.rb
index 01d498e1bc..9ca6612512 100644
--- a/actionpack/examples/address_book_controller.rb
+++ b/actionpack/examples/address_book_controller.rb
@@ -28,11 +28,11 @@ class AddressBookController < ActionController::Base
end
def person
- @person = @address_book.find_person(@params["id"])
+ @person = @address_book.find_person(params[:id])
end
def create_person
- @address_book.create_person(@params["person"])
+ @address_book.create_person(params[:person])
redirect_to :action => "index"
end
@@ -49,4 +49,4 @@ begin
AddressBookController.process_cgi(CGI.new) if $0 == __FILE__
rescue => e
CGI.new.out { "#{e.class}: #{e.message}" }
-end \ No newline at end of file
+end
diff --git a/actionpack/examples/blog_controller.cgi b/actionpack/examples/blog_controller.cgi
index b0c14033a2..3868c306df 100755
--- a/actionpack/examples/blog_controller.cgi
+++ b/actionpack/examples/blog_controller.cgi
@@ -32,7 +32,7 @@ class BlogController < ActionController::Base
end
def create
- @session["posts"].unshift(Post.new(@params["post"]["title"], @params["post"]["body"]))
+ @session["posts"].unshift(Post.new(params[:post][:title], params[:post][:body]))
flash["alert"] = "New post added!"
redirect_to :action => "index"
end
diff --git a/actionpack/examples/debate_controller.cgi b/actionpack/examples/debate_controller.cgi
index b82ac6259d..dbe022568b 100755
--- a/actionpack/examples/debate_controller.cgi
+++ b/actionpack/examples/debate_controller.cgi
@@ -25,19 +25,19 @@ class DebateController < ActionController::Base
end
def topic
- @topic = @debate.find_topic(@params["id"])
+ @topic = @debate.find_topic(params[:id])
end
# def new_topic() end <-- This is not needed as the template doesn't require any assigns
def create_topic
- @debate.create_topic(@params["topic"])
+ @debate.create_topic(params[:topic])
redirect_to :action => "index"
end
def create_reply
- @debate.create_reply(@params["reply"])
- redirect_to :action => "topic", :path_params => { "id" => @params["reply"]["topic_id"] }
+ @debate.create_reply(params[:reply])
+ redirect_to :action => "topic", :path_params => { "id" => params[:reply][:topic_id] }
end
private
@@ -54,4 +54,4 @@ begin
DebateController.process_cgi(CGI.new) if $0 == __FILE__
rescue => e
CGI.new.out { "#{e.class}: #{e.message}" }
-end \ No newline at end of file
+end