Skip to content
This repository
Browse code

A few updates to Getting Started guide

  • Loading branch information...
commit 5c90c988f81b3ca3bfe74ce413c882ce9f17d501 1 parent ecfcb49
Mike Gunderloy authored October 16, 2008
7  railties/doc/guides/getting_started_with_rails/getting_started_with_rails.txt
@@ -18,6 +18,7 @@ This guide is designed for beginners who want to get started with a Rails applic
18 18
 
19 19
 It is highly recommended that you *familiarize yourself with Ruby before diving into Rails*. You will find it much easier to follow what's going on with a Rails application if you understand basic Ruby syntax. Rails isn't going to magically revolutionize the way you write web applications if you have no experience with the language it uses. There are some good free resources on the net for learning Ruby, including:
20 20
 
  21
+* link:http://www.humblelittlerubybook.com/[Mr. Neigborly’s Humble Little Ruby Book]
21 22
 * link:http://www.rubycentral.com/book/[Programming Ruby]
22 23
 * link:http://poignantguide.net/ruby/[Why's (Poignant) Guide to Ruby]
23 24
 
@@ -510,7 +511,7 @@ This view iterates over the contents of the +@posts+ array to display content an
510 511
 * +link_to+ builds a hyperlink to a particular destination
511 512
 * +edit_post_path+ is a helper that Rails provides as part of RESTful routing. You’ll see a variety of these helpers for the different actions that the controller includes.
512 513
 
513  
-TIP: For more details on the rendering process, see link:../actionview/layouts_and_rendering [Layouts and Rendering in Rails].
  514
+TIP: For more details on the rendering process, see link:../actionview/layouts_and_rendering.html[Layouts and Rendering in Rails].
514 515
 
515 516
 === Customizing the Layout
516 517
 
@@ -584,7 +585,9 @@ The +new.html.erb+ view displays this empty Post to the user:
584 585
 <%= link_to 'Back', posts_path %>
585 586
 -------------------------------------------------------
586 587
 
587  
-The +form_for+ block is used to create an HTML form. Within this block, you have access to methods to build various controls on the form. For example, +f.text_field :name+ tells Rails to create a text input on the form, and to hook it up to the +name+ attribute of the instance being displayed. Rails uses +form_for+ in preference to having your write raw HTML because the code is more succinct, and because it explicitly ties the form to a particular model instance.
  588
+The +form_for+ block is used to create an HTML form. Within this block, you have access to methods to build various controls on the form. For example, +f.text_field :name+ tells Rails to create a text input on the form, and to hook it up to the +name+ attribute of the instance being displayed. You can only use these methods with attributes of the model that the form is based on (in this case +name+, +title+, and +content+). Rails uses +form_for+ in preference to having your write raw HTML because the code is more succinct, and because it explicitly ties the form to a particular model instance.
  589
+
  590
+TIP: If you need to create an HTML form that displays arbitrary fields, not tied to a model, you should use the +form_tag+ method, which provides shortcuts for building forms that are not necessarily tied to a model instance.
588 591
 
589 592
 When the user clicks the +Create+ button on this form, the browser will send information back to the +create+ method of the controller (Rails knows to call the +create+ method because the form is sent with an HTTP POST request; that's one of the conventions that I mentioned earlier):
590 593
 

0 notes on commit 5c90c98

Please sign in to comment.
Something went wrong with that request. Please try again.