From 2c8bc2cdcdb7b144b7a583d24922fd8064bcff3d Mon Sep 17 00:00:00 2001 From: Paul Nikitochkin Date: Fri, 6 Sep 2013 21:41:04 +0300 Subject: Use Ruby on Rails Coding Conventions for code examples in the guides * Indent after private/protected * Ruby >= 1.9 syntax for hashes * Prefer method { do_stuff } instead of method{do_stuff} for single-line blocks. [ci skip] --- guides/source/form_helpers.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'guides/source/form_helpers.md') diff --git a/guides/source/form_helpers.md b/guides/source/form_helpers.md index 578cfbe105..39852cb00a 100644 --- a/guides/source/form_helpers.md +++ b/guides/source/form_helpers.md @@ -914,9 +914,9 @@ def create end private -def person_params - params.require(:person).permit(:name, addresses_attributes: [:id, :kind, :street]) -end + def person_params + params.require(:person).permit(:name, addresses_attributes: [:id, :kind, :street]) + end ``` ### Removing Objects -- cgit v1.2.3 From 1e667aa5f4859431750940ee1a4663ee6c9fad7e Mon Sep 17 00:00:00 2001 From: Sergio Date: Mon, 9 Sep 2013 17:30:09 +0200 Subject: html generated for a search form There's a div that is generated in rails for a default search form and is not includen in the example. --- guides/source/form_helpers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/form_helpers.md') diff --git a/guides/source/form_helpers.md b/guides/source/form_helpers.md index 578cfbe105..bf9bf4a47f 100644 --- a/guides/source/form_helpers.md +++ b/guides/source/form_helpers.md @@ -67,7 +67,7 @@ To create this form you will use `form_tag`, `label_tag`, `text_field_tag`, and This will generate the following HTML: ```html -
+
-- cgit v1.2.3 From 7cd1b3e675a1f1f4abb0f3f7061c22b796eb5809 Mon Sep 17 00:00:00 2001 From: Juanito Fatas Date: Sun, 15 Sep 2013 23:04:49 +0800 Subject: [ci skip] Consistency wording of 9.6 in form_helpers.md Chapter 9 is giving a user and set of addresses example. So 'Add a new address' would be more consistent. Also change the javascript to JavaScript. --- guides/source/form_helpers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/form_helpers.md') diff --git a/guides/source/form_helpers.md b/guides/source/form_helpers.md index 0287b3df73..4b6d8a93f0 100644 --- a/guides/source/form_helpers.md +++ b/guides/source/form_helpers.md @@ -973,4 +973,4 @@ As a convenience you can instead pass the symbol `:all_blank` which will create ### Adding Fields on the Fly -Rather than rendering multiple sets of fields ahead of time you may wish to add them only when a user clicks on an 'Add new child' button. Rails does not provide any builtin support for this. When generating new sets of fields you must ensure the key of the associated array is unique - the current javascript date (milliseconds after the epoch) is a common choice. +Rather than rendering multiple sets of fields ahead of time you may wish to add them only when a user clicks on an 'Add new address' button. Rails does not provide any builtin support for this. When generating new sets of fields you must ensure the key of the associated array is unique - the current JavaScript date (milliseconds after the epoch) is a common choice. -- cgit v1.2.3