From 181a9fdafe1fef515db3dbd3d580e55e283afc9a Mon Sep 17 00:00:00 2001 From: bogdanvlviv Date: Tue, 26 Dec 2017 13:30:39 +0200 Subject: Update "Action View Overview" guide [ci skip] - Provide full / Fix generated HTML by `form_for` in the example. - Provide full params in the example. - Express params[:person] in the sentence. --- guides/source/action_view_overview.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'guides/source/action_view_overview.md') diff --git a/guides/source/action_view_overview.md b/guides/source/action_view_overview.md index fde2040173..1cba5c6fb6 100644 --- a/guides/source/action_view_overview.md +++ b/guides/source/action_view_overview.md @@ -807,20 +807,22 @@ The core method of this helper, `form_for`, gives you the ability to create a fo The HTML generated for this would be: ```html -
- - - + + + + + +
``` The params object created when this form is submitted would look like: ```ruby -{ "action" => "create", "controller" => "people", "person" => { "first_name" => "William", "last_name" => "Smith" } } +{"utf8" => "✓", "authenticity_token" => "lTuvBzs7ANygT0NFinXj98tfw3Emfm65wwYLbUvoWsK2pngccIQSUorM2C035M9dZswXgWTvKwFS8W5TVblpYw==", "person" => {"first_name" => "William", "last_name" => "Smith"}, "commit" => "Create", "controller" => "people", "action" => "create"} ``` -The params hash has a nested person value, which can therefore be accessed with params[:person] in the controller. +The params hash has a nested person value, which can therefore be accessed with `params[:person]` in the controller. #### check_box -- cgit v1.2.3