diff options
-rw-r--r-- | guides/source/getting_started.md | 8 | ||||
-rw-r--r-- | guides/source/security.md | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index ecc3f95a76..7c7b3a4c01 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -1165,7 +1165,7 @@ it look as follows: ```html+erb <h1>Edit article</h1> -<%= form_with(model: @article) do |form| %> +<%= form_with(model: @article, local: true) do |form| %> <% if @article.errors.any? %> <div id="error_explanation"> @@ -1768,7 +1768,7 @@ add that to the `app/views/articles/show.html.erb`. <% end %> <h2>Add a comment:</h2> -<%= form_with(model: [ @article, @article.comments.build ]) do |form| %> +<%= form_with(model: [ @article, @article.comments.build ], local: true) do |form| %> <p> <%= form.label :commenter %><br> <%= form.text_field :commenter %> @@ -1834,7 +1834,7 @@ following: <%= render @article.comments %> <h2>Add a comment:</h2> -<%= form_with(model: [ @article, @article.comments.build ]) do |form| %> +<%= form_with(model: [ @article, @article.comments.build ], local: true) do |form| %> <p> <%= form.label :commenter %><br> <%= form.text_field :commenter %> @@ -1864,7 +1864,7 @@ Let us also move that new comment section out to its own partial. Again, you create a file `app/views/comments/_form.html.erb` containing: ```html+erb -<%= form_with(model: [ @article, @article.comments.build ]) do |form| %> +<%= form_with(model: [ @article, @article.comments.build ], local: true) do |form| %> <p> <%= form.label :commenter %><br> <%= form.text_field :commenter %> diff --git a/guides/source/security.md b/guides/source/security.md index a74de22ac0..2ac52155f8 100644 --- a/guides/source/security.md +++ b/guides/source/security.md @@ -1038,18 +1038,18 @@ By default, this file contains the application's access keys for external APIs. The credentials added to this file are accessible via `Rails.application.credentials`. -For example, with the following decrypted `config/credentails.yml.enc`: +For example, with the following decrypted `config/credentials.yml.enc`: secret_key_base: 3b7cd727ee24e8444053437c36cc66c3 some_api_key: SOMEKEY -`Rails.application.credentails.some_api_key` returns `SOMEKEY` in any environment. +`Rails.application.credentials.some_api_key` returns `SOMEKEY` in any environment. If you want an exception to be raised when some key is blank, use the bang version: ```ruby -Rails.application.credentails.some_api_key! # => raises KeyError: key not found: :some_api_key +Rails.application.credentials.some_api_key! # => raises KeyError: key not found: :some_api_key ``` Additional Resources |