From 4316f2abedf50f7c6bf405935693c63042b75ee6 Mon Sep 17 00:00:00 2001 From: Jonathan Powers Date: Thu, 5 Jun 2014 00:25:41 -0500 Subject: Update getting_started.md It may be confusing to a Rails newbie why "Article" is suddenly being referred to with the "A" being capitalized. Thus far in the guide, the "a" has always been in lowercase. I think it is helpful to point out the reason for this change (especially since not using the capital "A" will result in an error). [ci skip] --- guides/source/getting_started.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'guides/source/getting_started.md') diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index d9619bbc21..83032aca5e 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -739,6 +739,8 @@ database columns. In the first line we do just that (remember that `@article.save` is responsible for saving the model in the database. Finally, we redirect the user to the `show` action, which we'll define later. +TIP: You might be wondering why the `A` in `Article.new` is capitalized above, whereas most other references to articles in this guide have used lowercase. In this context, we are referring to the class named `Article` that is defined in `\models\article.rb`. Class names in Ruby must begin with a capital letter. + TIP: As we'll see later, `@article.save` returns a boolean indicating whether the article was saved or not. -- cgit v1.2.3 From d99172e450edba77df0990ba758a2a8396f3a4f6 Mon Sep 17 00:00:00 2001 From: Jonathan Powers Date: Thu, 5 Jun 2014 00:26:56 -0500 Subject: Update getting_started.md It's not very clear exactly what the "params" method is and does, as the current description in the guide is somewhat vague and brief. An example is helpful, especially considering this method is referenced over 30 times in this guide. [ci skip] --- guides/source/getting_started.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'guides/source/getting_started.md') diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index 83032aca5e..e088abc150 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -623,6 +623,8 @@ method returns an `ActiveSupport::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. +TIP: Ensure you have a firm grasp of the `params` method, as you'll use it fairly regularly. Let's consider an example URL: **http://www.example.com/?username=dhh&email=dhh@email.com**. In this URL, `params[:username]` would equal "dhh" and `params[:email]` would equal "dhh@email.com". + 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: -- cgit v1.2.3