From 9233f52bd96081c728b7087af9435d4fbadb7e46 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 17 Aug 2016 12:49:56 +0200 Subject: Fix diffrent naming in getting_started.md I've noticed that once `

Editing article

` L1157 was the title and then later on it's `

Edit article

` L1358 which kind of makes more sense... [ci skip] --- guides/source/getting_started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source') diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index 0cb5d81042..ef469fccc3 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -1154,7 +1154,7 @@ new articles. Create a file called `app/views/articles/edit.html.erb` and make it look as follows: ```html+erb -

Editing article

+

Edit article

<%= form_for :article, url: article_path(@article), method: :patch do |f| %> -- cgit v1.2.3 From ce17ac27736efb3c5b9c9532f0d4388f3164dad8 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 17 Aug 2016 15:28:54 +0200 Subject: Fix #26187 As "discussed" in #26187 I added the route that magically disappeared again. --- guides/source/getting_started.md | 1 + 1 file changed, 1 insertion(+) (limited to 'guides/source') diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index ef469fccc3..d56b817bad 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -353,6 +353,7 @@ resource. You need to add the _article resource_ to the ```ruby Rails.application.routes.draw do + get 'welcome/index' resources :articles -- cgit v1.2.3 From fbaa5e390f018615bedb5e7c0f7ec2df24840963 Mon Sep 17 00:00:00 2001 From: "Ian C. Anderson" Date: Wed, 17 Aug 2016 10:25:04 -0400 Subject: i18n documentation for required belongs_to message When you don't explicitly provide `optional: true` to a `belongs_to` definition, rails adds a validation to ensure presence of the `belongs_to` validation. However, when the validation is added, it is added with a message key of `:required`, which was not documented in the "Translations for Active Record Models" section of the i18n guides. Here are the lines that add the `:required` message: https://github.com/rails/rails/blob/c3e3577f9d5058382504773bf0d32afa15cb131e/activerecord/lib/active_record/associations/builder/belongs_to.rb#L136-L138 This commit adds the "non-optional association" validation to the table, so rails users know how to override the message for this validation. The default message is "must exist". --- guides/source/i18n.md | 1 + 1 file changed, 1 insertion(+) (limited to 'guides/source') diff --git a/guides/source/i18n.md b/guides/source/i18n.md index e623f8cf8a..1565008a69 100644 --- a/guides/source/i18n.md +++ b/guides/source/i18n.md @@ -888,6 +888,7 @@ So, for example, instead of the default error message `"cannot be blank"` you co | inclusion | - | :inclusion | - | | exclusion | - | :exclusion | - | | associated | - | :invalid | - | +| non-optional association | - | :required | - | | numericality | - | :not_a_number | - | | numericality | :greater_than | :greater_than | count | | numericality | :greater_than_or_equal_to | :greater_than_or_equal_to | count | -- cgit v1.2.3