aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
Diffstat (limited to 'guides')
-rw-r--r--guides/assets/images/getting_started/new_post.pngbin0 -> 14334 bytes
-rw-r--r--guides/assets/images/getting_started/routing_error_no_controller.pngbin0 -> 15744 bytes
-rw-r--r--guides/assets/images/getting_started/routing_error_no_route_matches.pngbin0 -> 16065 bytes
-rw-r--r--guides/assets/images/getting_started/template_is_missing_posts_new.pngbin0 -> 15168 bytes
-rw-r--r--guides/assets/images/getting_started/unknown_action_create_for_posts.pngbin0 -> 12652 bytes
-rw-r--r--guides/assets/images/getting_started/unknown_action_new_for_posts.pngbin0 -> 12756 bytes
-rw-r--r--guides/source/getting_started.textile8
7 files changed, 5 insertions, 3 deletions
diff --git a/guides/assets/images/getting_started/new_post.png b/guides/assets/images/getting_started/new_post.png
new file mode 100644
index 0000000000..dc9459032a
--- /dev/null
+++ b/guides/assets/images/getting_started/new_post.png
Binary files differ
diff --git a/guides/assets/images/getting_started/routing_error_no_controller.png b/guides/assets/images/getting_started/routing_error_no_controller.png
new file mode 100644
index 0000000000..92a39efd78
--- /dev/null
+++ b/guides/assets/images/getting_started/routing_error_no_controller.png
Binary files differ
diff --git a/guides/assets/images/getting_started/routing_error_no_route_matches.png b/guides/assets/images/getting_started/routing_error_no_route_matches.png
new file mode 100644
index 0000000000..bc768a94a2
--- /dev/null
+++ b/guides/assets/images/getting_started/routing_error_no_route_matches.png
Binary files differ
diff --git a/guides/assets/images/getting_started/template_is_missing_posts_new.png b/guides/assets/images/getting_started/template_is_missing_posts_new.png
new file mode 100644
index 0000000000..9f070d59db
--- /dev/null
+++ b/guides/assets/images/getting_started/template_is_missing_posts_new.png
Binary files differ
diff --git a/guides/assets/images/getting_started/unknown_action_create_for_posts.png b/guides/assets/images/getting_started/unknown_action_create_for_posts.png
new file mode 100644
index 0000000000..03d92dfb7d
--- /dev/null
+++ b/guides/assets/images/getting_started/unknown_action_create_for_posts.png
Binary files differ
diff --git a/guides/assets/images/getting_started/unknown_action_new_for_posts.png b/guides/assets/images/getting_started/unknown_action_new_for_posts.png
new file mode 100644
index 0000000000..b63883d922
--- /dev/null
+++ b/guides/assets/images/getting_started/unknown_action_new_for_posts.png
Binary files differ
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