aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/getting_started.textile
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2012-03-19 18:28:10 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2012-03-19 18:28:10 +0530
commit9c748f3961816d10b4a7be7b66a70b3b4bcd52cf (patch)
tree27783eed01c3e2531b6764fb42e14d55e85a97a1 /guides/source/getting_started.textile
parent50b3113eb4ca29fdf6db44b4ef07861c6a0f58c4 (diff)
parent426840c33caf8b14060c7bbf7dbddb0462699812 (diff)
downloadrails-9c748f3961816d10b4a7be7b66a70b3b4bcd52cf.tar.gz
rails-9c748f3961816d10b4a7be7b66a70b3b4bcd52cf.tar.bz2
rails-9c748f3961816d10b4a7be7b66a70b3b4bcd52cf.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'guides/source/getting_started.textile')
-rw-r--r--guides/source/getting_started.textile8
1 files changed, 5 insertions, 3 deletions
diff --git a/guides/source/getting_started.textile b/guides/source/getting_started.textile
index 8196a67d35..fdae21caf2 100644
--- a/guides/source/getting_started.textile
+++ b/guides/source/getting_started.textile
@@ -371,17 +371,19 @@ When a form is submitted, the fields of the form are sent to Rails as _parameter
<ruby>
def create
- render :text => params.inspect
+ render :text => params[:post].inspect
end
</ruby>
-The +render+ method here is taking a very simple hash with the key of +text+ and the value of +params.inspect+. The +params+ method here is the object which represents the parameters (or fields) coming in from the form. If you re-submit the form one more time you'll now no longer get the missing template error. Instead, you'll see something that looks like the following:
+The +render+ method here is taking a very simple hash with the key of +text+ and the value of +params[:post].inspect+. The +params+ method here is the object which represents the parameters (or fields) coming in from the form. The +params+ method returns a +HashWithIndifferentAccess+ object, which allows you to access the keys of the hash using either strings or symbols. In this situation, the only parameters that matter are the ones from the form.
+
+If you re-submit the form one more time you'll now no longer get the missing template error. Instead, you'll see something that looks like the following:
<ruby>
{"title"=>"First post!", "text"=>"This is my first post."}
</ruby>
-
+This action is now displaying the parameters for the post that are coming in from the form. However, this isn't really all that helpful. Yes, you can see the parameters but nothing in particular is being done with them.
h4. Running a Migration