From 9ff773124353f6d0b20638c05ce1d5e02c5e5945 Mon Sep 17 00:00:00 2001 From: benhayehudi Date: Sat, 16 Jan 2021 19:13:09 +0200 Subject: [PATCH 1/3] switch references to main branch in docs --- guides/source/_welcome.html.erb | 2 +- guides/source/action_mailer_basics.md | 2 +- guides/source/active_storage_overview.md | 4 +- .../source/contributing_to_ruby_on_rails.md | 54 +++++++++---------- guides/source/i18n.md | 14 ++--- guides/source/kindle/rails_guides.opf.erb | 2 +- guides/source/layout.html.erb | 4 +- guides/source/maintenance_policy.md | 2 +- guides/source/security.md | 2 +- .../working_with_javascript_in_rails.md | 4 +- 10 files changed, 45 insertions(+), 45 deletions(-) diff --git a/guides/source/_welcome.html.erb b/guides/source/_welcome.html.erb index 77f1ac79f8..2f5c79e8aa 100644 --- a/guides/source/_welcome.html.erb +++ b/guides/source/_welcome.html.erb @@ -2,7 +2,7 @@ <% if @edge %>

- These are Edge Guides, based on master@<%= @edge[0, 7] %>. + These are Edge Guides, based on main@<%= @edge[0, 7] %>.

If you are looking for the ones for the stable version, please check diff --git a/guides/source/action_mailer_basics.md b/guides/source/action_mailer_basics.md index 8be71f6258..2f3da94944 100644 --- a/guides/source/action_mailer_basics.md +++ b/guides/source/action_mailer_basics.md @@ -608,7 +608,7 @@ URL helper. <%= user_url(@user, host: 'example.com') %> ``` -NOTE: non-`GET` links require [rails-ujs](https://github.com/rails/rails/blob/master/actionview/app/assets/javascripts) or +NOTE: non-`GET` links require [rails-ujs](https://github.com/rails/rails/blob/main/actionview/app/assets/javascripts) or [jQuery UJS](https://github.com/rails/jquery-ujs), and won't work in mailer templates. They will result in normal `GET` requests. diff --git a/guides/source/active_storage_overview.md b/guides/source/active_storage_overview.md index 26d5fba6d8..4ed259c2e2 100644 --- a/guides/source/active_storage_overview.md +++ b/guides/source/active_storage_overview.md @@ -483,7 +483,7 @@ accessible by default. Anyone that knows the blob URL will be able to download i even if a `before_action` in your `ApplicationController` would otherwise require a login. If your files require a higher level of protection consider implementing your own authenticated -[`ActiveStorage::Blobs::RedirectController`](https://github.com/rails/rails/blob/master/activestorage/app/controllers/active_storage/blobs/redirect_controller.rb) and [`ActiveStorage::Representations::RedirectController`](https://github.com/rails/rails/blob/master/activestorage/app/controllers/active_storage/representations/redirect_controller.rb). +[`ActiveStorage::Blobs::RedirectController`](https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/blobs/redirect_controller.rb) and [`ActiveStorage::Representations::RedirectController`](https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/representations/redirect_controller.rb). To create a download link, use the `rails_blob_{path|url}` helper. Using this helper allows you to set the disposition. @@ -1006,5 +1006,5 @@ Implementing Support for Other Cloud Services If you need to support a cloud service other than these, you will need to implement the Service. Each service extends -[`ActiveStorage::Service`](https://github.com/rails/rails/blob/master/activestorage/lib/active_storage/service.rb) +[`ActiveStorage::Service`](https://github.com/rails/rails/blob/main/activestorage/lib/active_storage/service.rb) by implementing the methods necessary to upload and download files to the cloud. diff --git a/guides/source/contributing_to_ruby_on_rails.md b/guides/source/contributing_to_ruby_on_rails.md index dcaf691d51..9ffdc275c8 100644 --- a/guides/source/contributing_to_ruby_on_rails.md +++ b/guides/source/contributing_to_ruby_on_rails.md @@ -8,7 +8,7 @@ This guide covers ways in which _you_ can become a part of the ongoing developme After reading this guide, you will know: * How to use GitHub to report issues. -* How to clone master and run the test suite. +* How to clone main and run the test suite. * How to help resolve existing issues. * How to contribute to the Ruby on Rails documentation. * How to contribute to the Ruby on Rails code. @@ -16,7 +16,7 @@ After reading this guide, you will know: Ruby on Rails is not "someone else's framework". Over the years, thousands of people have contributed to Ruby on Rails ranging from a single character to massive architectural changes or significant documentation - all with the goal of making Ruby on Rails better for everyone. Even if you don't feel up to writing code or documentation yet, there are a variety of other ways that you can contribute, from reporting issues to testing patches. As mentioned in [Rails' -README](https://github.com/rails/rails/blob/master/README.md), everyone interacting in Rails and its sub-projects' codebases, issue trackers, chat rooms, and mailing lists is expected to follow the Rails [code of conduct](https://rubyonrails.org/conduct/). +README](https://github.com/rails/rails/blob/main/README.md), everyone interacting in Rails and its sub-projects' codebases, issue trackers, chat rooms, and mailing lists is expected to follow the Rails [code of conduct](https://rubyonrails.org/conduct/). -------------------------------------------------------------------------------- @@ -39,13 +39,13 @@ Then, don't get your hopes up! Unless you have a "Code Red, Mission Critical, th Having a way to reproduce your issue will be very helpful for others to help confirm, investigate, and ultimately fix your issue. You can do this by providing an executable test case. To make this process easier, we have prepared several bug report templates for you to use as a starting point: -* Template for Active Record (models, database) issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_master.rb) -* Template for testing Active Record (migration) issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_migrations_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_migrations_master.rb) -* Template for Action Pack (controllers, routing) issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_controller_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_controller_master.rb) -* Template for Active Job issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_job_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_job_master.rb) -* Template for Active Storage issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_storage_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_storage_master.rb) -* Template for Action Mailbox issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_mailbox_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_mailbox_master.rb) -* Generic template for other issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/generic_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/generic_master.rb) +* Template for Active Record (models, database) issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_master.rb) +* Template for testing Active Record (migration) issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_migrations_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_migrations_master.rb) +* Template for Action Pack (controllers, routing) issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_controller_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_controller_master.rb) +* Template for Active Job issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_job_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_job_master.rb) +* Template for Active Storage issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_storage_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_storage_master.rb) +* Template for Action Mailbox issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_mailbox_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_mailbox_master.rb) +* Generic template for other issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/generic_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/generic_master.rb) These templates include the boilerplate code to set up a test case against either a released version of Rails (`*_gem.rb`) or edge Rails (`*_master.rb`). @@ -137,7 +137,7 @@ learn about Ruby on Rails, and the API, which serves as a reference. You can help improve the Rails guides or the API reference by making them more coherent, consistent, or readable, adding missing information, correcting factual errors, fixing typos, or bringing them up to date with the latest edge Rails. To do so, make changes to Rails guides source files (located [here](https://github.com/rails/rails/tree/master/guides/source) on GitHub) or RDoc comments in source code. Then open a pull request to apply your -changes to the master branch. +changes to the main branch. When working with documentation, please take into account the [API Documentation Guidelines](api_documentation_guidelines.html) and the [Ruby on Rails Guides Guidelines](ruby_on_rails_guides_guidelines.html). @@ -291,7 +291,7 @@ Therefore, you should test your change against a list of representative scenarios. Ideally, they should be based on real-world scenarios extracted from production applications. -You can use the [benchmark template](https://github.com/rails/rails/blob/master/guides/bug_report_templates/benchmark.rb) +You can use the [benchmark template](https://github.com/rails/rails/blob/main/guides/bug_report_templates/benchmark.rb) as a starting point. It includes the boilerplate code to set up a benchmark using the [benchmark-ips](https://github.com/evanphx/benchmark-ips) gem. The template is designed for testing relatively self-contained changes that can be @@ -532,10 +532,10 @@ simplifies future cherry picks and keeps the git log clean. ### Update Your Branch -It's pretty likely that other changes to master have happened while you were working. Go get them: +It's pretty likely that other changes to main have happened while you were working. Go get them: ```bash -$ git checkout master +$ git checkout main $ git pull --rebase ``` @@ -543,7 +543,7 @@ Now reapply your patch on top of the latest changes: ```bash $ git checkout my_new_branch -$ git rebase master +$ git rebase main ``` No conflicts? Tests still pass? Change still seems reasonable to you? Then move on. @@ -573,16 +573,16 @@ $ git fetch rails Merge the new content: ```bash -$ git checkout master -$ git rebase rails/master +$ git checkout main +$ git rebase rails/main $ git checkout my_new_branch -$ git rebase rails/master +$ git rebase rails/main ``` Update your fork: ```bash -$ git push fork master +$ git push fork main $ git push fork my_new_branch ``` @@ -594,7 +594,7 @@ the right panel. On the next page, press "New pull request" in the upper right hand corner. Click on "Edit", if you need to change the branches being compared (it compares -"master" by default) and press "Click to create a pull request for this +"main" by default) and press "Click to create a pull request for this comparison". Ensure the changesets you introduced are included. Fill in some details about @@ -643,7 +643,7 @@ extraneous commits can add a lot of noise. ```bash $ git fetch rails $ git checkout my_new_branch -$ git rebase -i rails/master +$ git rebase -i rails/main < Choose 'squash' for all of your commits except the first one. > < Edit the commit message to make sense, and describe all your changes. > @@ -687,20 +687,20 @@ NOTE: Before working on older versions, please check the [maintenance policy](ma #### Backporting -Changes that are merged into master are intended for the next major release of Rails. Sometimes, it might be beneficial for your changes to propagate back to the maintenance releases for older stable branches. Generally, security fixes and bug fixes are good candidates for a backport, while new features and patches that introduce a change in behavior will not be accepted. When in doubt, it is best to consult a Rails team member before backporting your changes to avoid wasted effort. +Changes that are merged into main are intended for the next major release of Rails. Sometimes, it might be beneficial for your changes to propagate back to the maintenance releases for older stable branches. Generally, security fixes and bug fixes are good candidates for a backport, while new features and patches that introduce a change in behavior will not be accepted. When in doubt, it is best to consult a Rails team member before backporting your changes to avoid wasted effort. -For simple fixes, the easiest way to backport your changes is to [extract a diff from your changes in master and apply them to the target branch](https://www.devroom.io/2009/10/26/how-to-create-and-apply-a-patch-with-git/). +For simple fixes, the easiest way to backport your changes is to [extract a diff from your changes in main and apply them to the target branch](https://www.devroom.io/2009/10/26/how-to-create-and-apply-a-patch-with-git/). -First, make sure your changes are the only difference between your current branch and master: +First, make sure your changes are the only difference between your current branch and mains: ```bash -$ git log master..HEAD +$ git log main..HEAD ``` Then extract the diff: ```bash -$ git format-patch master --stdout > ~/my_changes.patch +$ git format-patch main --stdout > ~/my_changes.patch ``` Switch over to the target branch and apply your changes: @@ -710,9 +710,9 @@ $ git checkout -b my_backport_branch 4-2-stable $ git apply ~/my_changes.patch ``` -This works well for simple changes. However, if your changes are complicated or if the code in master has deviated significantly from your target branch, it might require more work on your part. The difficulty of a backport varies greatly from case to case, and sometimes it is simply not worth the effort. +This works well for simple changes. However, if your changes are complicated or if the code in main has deviated significantly from your target branch, it might require more work on your part. The difficulty of a backport varies greatly from case to case, and sometimes it is simply not worth the effort. -Once you have resolved all conflicts and made sure all the tests are passing, push your changes and open a separate pull request for your backport. It is also worth noting that older branches might have a different set of build targets than master. When possible, it is best to first test your backport locally against the oldest Ruby version permitted by the target branch's `rails.gemspec` before submitting your pull request. +Once you have resolved all conflicts and made sure all the tests are passing, push your changes and open a separate pull request for your backport. It is also worth noting that older branches might have a different set of build targets than main. When possible, it is best to first test your backport locally against the oldest Ruby version permitted by the target branch's `rails.gemspec` before submitting your pull request. And then... think about your next contribution! diff --git a/guides/source/i18n.md b/guides/source/i18n.md index 29ab45b2e4..1c5f4e0206 100644 --- a/guides/source/i18n.md +++ b/guides/source/i18n.md @@ -103,7 +103,7 @@ en: hello: "Hello world" ``` -This means, that in the `:en` locale, the key _hello_ will map to the _Hello world_ string. Every string inside Rails is internationalized in this way, see for instance Active Model validation messages in the [`activemodel/lib/active_model/locale/en.yml`](https://github.com/rails/rails/blob/master/activemodel/lib/active_model/locale/en.yml) file or time and date formats in the [`activesupport/lib/active_support/locale/en.yml`](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml) file. You can use YAML or standard Ruby Hashes to store translations in the default (Simple) backend. +This means, that in the `:en` locale, the key _hello_ will map to the _Hello world_ string. Every string inside Rails is internationalized in this way, see for instance Active Model validation messages in the [`activemodel/lib/active_model/locale/en.yml`](https://github.com/rails/rails/blob/main/activemodel/lib/active_model/locale/en.yml) file or time and date formats in the [`activesupport/lib/active_support/locale/en.yml`](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/locale/en.yml) file. You can use YAML or standard Ruby Hashes to store translations in the default (Simple) backend. The I18n library will use **English** as a **default locale**, i.e. if a different locale is not set, `:en` will be used for looking up translations. @@ -1043,23 +1043,23 @@ Rails uses fixed strings and other localizations, such as format strings and oth #### Action View Helper Methods -* `distance_of_time_in_words` translates and pluralizes its result and interpolates the number of seconds, minutes, hours, and so on. See [datetime.distance_in_words](https://github.com/rails/rails/blob/master/actionview/lib/action_view/locale/en.yml#L4) translations. +* `distance_of_time_in_words` translates and pluralizes its result and interpolates the number of seconds, minutes, hours, and so on. See [datetime.distance_in_words](https://github.com/rails/rails/blob/main/actionview/lib/action_view/locale/en.yml#L4) translations. -* `datetime_select` and `select_month` use translated month names for populating the resulting select tag. See [date.month_names](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L15) for translations. `datetime_select` also looks up the order option from [date.order](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L18) (unless you pass the option explicitly). All date selection helpers translate the prompt using the translations in the [datetime.prompts](https://github.com/rails/rails/blob/master/actionview/lib/action_view/locale/en.yml#L39) scope if applicable. +* `datetime_select` and `select_month` use translated month names for populating the resulting select tag. See [date.month_names](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/locale/en.yml#L15) for translations. `datetime_select` also looks up the order option from [date.order](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/locale/en.yml#L18) (unless you pass the option explicitly). All date selection helpers translate the prompt using the translations in the [datetime.prompts](https://github.com/rails/rails/blob/main/actionview/lib/action_view/locale/en.yml#L39) scope if applicable. -* The `number_to_currency`, `number_with_precision`, `number_to_percentage`, `number_with_delimiter`, and `number_to_human_size` helpers use the number format settings located in the [number](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L37) scope. +* The `number_to_currency`, `number_with_precision`, `number_to_percentage`, `number_with_delimiter`, and `number_to_human_size` helpers use the number format settings located in the [number](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/locale/en.yml#L37) scope. #### Active Model Methods -* `model_name.human` and `human_attribute_name` use translations for model names and attribute names if available in the [activerecord.models](https://github.com/rails/rails/blob/master/activerecord/lib/active_record/locale/en.yml#L36) scope. They also support translations for inherited class names (e.g. for use with STI) as explained above in "Error message scopes". +* `model_name.human` and `human_attribute_name` use translations for model names and attribute names if available in the [activerecord.models](https://github.com/rails/rails/blob/main/activerecord/lib/active_record/locale/en.yml#L36) scope. They also support translations for inherited class names (e.g. for use with STI) as explained above in "Error message scopes". * `ActiveModel::Errors#generate_message` (which is used by Active Model validations but may also be used manually) uses `model_name.human` and `human_attribute_name` (see above). It also translates the error message and supports translations for inherited class names as explained above in "Error message scopes". -* `ActiveModel::Errors#full_messages` prepends the attribute name to the error message using a separator that will be looked up from [errors.format](https://github.com/rails/rails/blob/master/activemodel/lib/active_model/locale/en.yml#L4) (and which defaults to `"%{attribute} %{message}"`). +* `ActiveModel::Errors#full_messages` prepends the attribute name to the error message using a separator that will be looked up from [errors.format](https://github.com/rails/rails/blob/main/activemodel/lib/active_model/locale/en.yml#L4) (and which defaults to `"%{attribute} %{message}"`). #### Active Support Methods -* `Array#to_sentence` uses format settings as given in the [support.array](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L33) scope. +* `Array#to_sentence` uses format settings as given in the [support.array](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/locale/en.yml#L33) scope. How to Store your Custom Translations ------------------------------------- diff --git a/guides/source/kindle/rails_guides.opf.erb b/guides/source/kindle/rails_guides.opf.erb index 1882ec1005..83d00cfc2e 100644 --- a/guides/source/kindle/rails_guides.opf.erb +++ b/guides/source/kindle/rails_guides.opf.erb @@ -5,7 +5,7 @@ - Ruby on Rails Guides (<%= @version || "master@#{@edge[0, 7]}" %>) + Ruby on Rails Guides (<%= @version || "main@#{@edge[0, 7]}" %>) en-us Ruby on Rails diff --git a/guides/source/layout.html.erb b/guides/source/layout.html.erb index 95c00a4ad0..cc89e47b9d 100644 --- a/guides/source/layout.html.erb +++ b/guides/source/layout.html.erb @@ -102,9 +102,9 @@

You may also find incomplete content or stuff that is not up to date. - Please do add any missing documentation for master. Make sure to check + Please do add any missing documentation for main. Make sure to check <%= link_to 'Edge Guides', 'https://edgeguides.rubyonrails.org' %> first to verify - if the issues are already fixed or not on the master branch. + if the issues are already fixed or not on the main branch. Check the <%= link_to 'Ruby on Rails Guides Guidelines', 'ruby_on_rails_guides_guidelines.html' %> for style and conventions.

diff --git a/guides/source/maintenance_policy.md b/guides/source/maintenance_policy.md index f117dc23da..0b138d9fd6 100644 --- a/guides/source/maintenance_policy.md +++ b/guides/source/maintenance_policy.md @@ -31,7 +31,7 @@ reserved for special occasions. New Features ------------ -New features are only added to the master branch and will not be made available +New features are only added to the main branch and will not be made available in point releases. Bug Fixes diff --git a/guides/source/security.md b/guides/source/security.md index 48e35736f1..84674173ec 100644 --- a/guides/source/security.md +++ b/guides/source/security.md @@ -299,7 +299,7 @@ protect_from_forgery with: :exception This will include a security token in all forms and Ajax requests generated by Rails. If the security token doesn't match what was expected, an exception will be thrown. -NOTE: By default, Rails includes an [unobtrusive scripting adapter](https://github.com/rails/rails/blob/master/actionview/app/assets/javascripts), +NOTE: By default, Rails includes an [unobtrusive scripting adapter](https://github.com/rails/rails/blob/main/actionview/app/assets/javascripts), which adds a header called `X-CSRF-Token` with the security token on every non-GET Ajax call. Without this header, non-GET Ajax requests won't be accepted by Rails. When using another library to make Ajax calls, it is necessary to add the security diff --git a/guides/source/working_with_javascript_in_rails.md b/guides/source/working_with_javascript_in_rails.md index 24c77dd45b..e95a08974c 100644 --- a/guides/source/working_with_javascript_in_rails.md +++ b/guides/source/working_with_javascript_in_rails.md @@ -159,7 +159,7 @@ Because of Unobtrusive JavaScript, the Rails "Ajax helpers" are actually in two parts: the JavaScript half and the Ruby half. Unless you have disabled the Asset Pipeline, -[rails-ujs](https://github.com/rails/rails/tree/master/actionview/app/assets/javascripts) +[rails-ujs](https://github.com/rails/rails/tree/main/actionview/app/assets/javascripts) provides the JavaScript half, and the regular Ruby view helpers add appropriate tags to your DOM. @@ -562,6 +562,6 @@ Other Resources Here are some helpful links to help you learn even more: -* [rails-ujs wiki](https://github.com/rails/rails/tree/master/actionview/app/assets/javascripts) +* [rails-ujs wiki](https://github.com/rails/rails/tree/main/actionview/app/assets/javascripts) * [Railscasts: Unobtrusive JavaScript](http://railscasts.com/episodes/205-unobtrusive-javascript) * [Railscasts: Turbolinks](http://railscasts.com/episodes/390-turbolinks) From 3589a575e9094b09d9246f38a10f1c1ab9acbfb4 Mon Sep 17 00:00:00 2001 From: Mike Rogers Date: Sat, 16 Jan 2021 17:13:45 +0000 Subject: [PATCH 2/3] Updating references to /rails/blob/master & raiks/tree/master to point to main --- CONTRIBUTING.md | 6 ++-- actionmailer/README.rdoc | 2 +- actionpack/README.rdoc | 2 +- actionview/README.rdoc | 2 +- .../assets/javascripts/rails-ujs/BANNER.js | 2 +- actionview/package.json | 2 +- activejob/README.md | 2 +- activemodel/README.rdoc | 2 +- activerecord/README.rdoc | 2 +- activestorage/README.md | 2 +- activesupport/README.rdoc | 2 +- guides/source/4_0_release_notes.md | 4 +-- guides/source/6_1_release_notes.md | 28 +++++++++---------- guides/source/6_2_release_notes.md | 26 ++++++++--------- guides/source/action_mailer_basics.md | 2 +- guides/source/active_storage_overview.md | 4 +-- .../source/contributing_to_ruby_on_rails.md | 20 ++++++------- guides/source/i18n.md | 14 +++++----- guides/source/security.md | 2 +- .../working_with_javascript_in_rails.md | 4 +-- railties/README.rdoc | 2 +- 21 files changed, 66 insertions(+), 66 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3cabc57bb2..d73eff4d3e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,9 +10,9 @@ * If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/rails/rails/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. * If possible, use the relevant bug report templates to create the issue. Simply copy the content of the appropriate template into a .rb file, make the necessary changes to demonstrate the issue, and **paste the content into the issue description**: - * [**Active Record** (models, database) issues](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_master.rb) - * [**Action Pack** (controllers, routing) issues](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_controller_master.rb) - * [**Generic template** for other issues](https://github.com/rails/rails/blob/master/guides/bug_report_templates/generic_master.rb) + * [**Active Record** (models, database) issues](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_master.rb) + * [**Action Pack** (controllers, routing) issues](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_controller_master.rb) + * [**Generic template** for other issues](https://github.com/rails/rails/blob/main/guides/bug_report_templates/generic_master.rb) * For more detailed information on submitting a bug report and creating an issue, visit our [reporting guidelines](https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#reporting-an-issue). diff --git a/actionmailer/README.rdoc b/actionmailer/README.rdoc index f9c84b4232..d55459de86 100644 --- a/actionmailer/README.rdoc +++ b/actionmailer/README.rdoc @@ -116,7 +116,7 @@ The latest version of Action Mailer can be installed with RubyGems: Source code can be downloaded as part of the Rails project on GitHub: -* https://github.com/rails/rails/tree/master/actionmailer +* https://github.com/rails/rails/tree/main/actionmailer == License diff --git a/actionpack/README.rdoc b/actionpack/README.rdoc index 67d0c62a84..30b52efb37 100644 --- a/actionpack/README.rdoc +++ b/actionpack/README.rdoc @@ -33,7 +33,7 @@ The latest version of Action Pack can be installed with RubyGems: Source code can be downloaded as part of the Rails project on GitHub: -* https://github.com/rails/rails/tree/master/actionpack +* https://github.com/rails/rails/tree/main/actionpack == License diff --git a/actionview/README.rdoc b/actionview/README.rdoc index 388aa4ff7b..fcc43c4eee 100644 --- a/actionview/README.rdoc +++ b/actionview/README.rdoc @@ -15,7 +15,7 @@ The latest version of Action View can be installed with RubyGems: Source code can be downloaded as part of the Rails project on GitHub: -* https://github.com/rails/rails/tree/master/actionview +* https://github.com/rails/rails/tree/main/actionview == License diff --git a/actionview/app/assets/javascripts/rails-ujs/BANNER.js b/actionview/app/assets/javascripts/rails-ujs/BANNER.js index 47ecd66003..6a48891886 100644 --- a/actionview/app/assets/javascripts/rails-ujs/BANNER.js +++ b/actionview/app/assets/javascripts/rails-ujs/BANNER.js @@ -1,5 +1,5 @@ /* Unobtrusive JavaScript -https://github.com/rails/rails/blob/master/actionview/app/assets/javascripts +https://github.com/rails/rails/blob/main/actionview/app/assets/javascripts Released under the MIT license */ diff --git a/actionview/package.json b/actionview/package.json index fac1d260df..91ab13d980 100644 --- a/actionview/package.json +++ b/actionview/package.json @@ -11,7 +11,7 @@ }, "scripts": { "build": "bundle exec blade build", - "test": "echo \"See the README: https://github.com/rails/rails/blob/master/actionview/app/assets/javascripts#how-to-run-tests\" && exit 1", + "test": "echo \"See the README: https://github.com/rails/rails/blob/main/actionview/app/assets/javascripts#how-to-run-tests\" && exit 1", "lint": "coffeelint app/assets/javascripts && eslint test/ujs/public/test" }, "repository": { diff --git a/activejob/README.md b/activejob/README.md index 4cb53e469c..6bcf68d608 100644 --- a/activejob/README.md +++ b/activejob/README.md @@ -106,7 +106,7 @@ The latest version of Active Job can be installed with RubyGems: Source code can be downloaded as part of the Rails project on GitHub: -* https://github.com/rails/rails/tree/master/activejob +* https://github.com/rails/rails/tree/main/activejob ## License diff --git a/activemodel/README.rdoc b/activemodel/README.rdoc index 8fd7ed7ed8..f68c5bfcd0 100644 --- a/activemodel/README.rdoc +++ b/activemodel/README.rdoc @@ -241,7 +241,7 @@ The latest version of Active Model can be installed with RubyGems: Source code can be downloaded as part of the Rails project on GitHub -* https://github.com/rails/rails/tree/master/activemodel +* https://github.com/rails/rails/tree/main/activemodel == License diff --git a/activerecord/README.rdoc b/activerecord/README.rdoc index f98076ccd3..306982d17b 100644 --- a/activerecord/README.rdoc +++ b/activerecord/README.rdoc @@ -194,7 +194,7 @@ The latest version of Active Record can be installed with RubyGems: Source code can be downloaded as part of the Rails project on GitHub: -* https://github.com/rails/rails/tree/master/activerecord +* https://github.com/rails/rails/tree/main/activerecord == License diff --git a/activestorage/README.md b/activestorage/README.md index 6fe95d9382..b5bca0af26 100644 --- a/activestorage/README.md +++ b/activestorage/README.md @@ -10,7 +10,7 @@ You can read more about Active Storage in the [Active Storage Overview](https:// ## Compared to other storage solutions -A key difference to how Active Storage works compared to other attachment solutions in Rails is through the use of built-in [Blob](https://github.com/rails/rails/blob/master/activestorage/app/models/active_storage/blob.rb) and [Attachment](https://github.com/rails/rails/blob/master/activestorage/app/models/active_storage/attachment.rb) models (backed by Active Record). This means existing application models do not need to be modified with additional columns to associate with files. Active Storage uses polymorphic associations via the `Attachment` join model, which then connects to the actual `Blob`. +A key difference to how Active Storage works compared to other attachment solutions in Rails is through the use of built-in [Blob](https://github.com/rails/rails/blob/main/activestorage/app/models/active_storage/blob.rb) and [Attachment](https://github.com/rails/rails/blob/main/activestorage/app/models/active_storage/attachment.rb) models (backed by Active Record). This means existing application models do not need to be modified with additional columns to associate with files. Active Storage uses polymorphic associations via the `Attachment` join model, which then connects to the actual `Blob`. `Blob` models store attachment metadata (filename, content-type, etc.), and their identifier key in the storage service. Blob models do not store the actual binary data. They are intended to be immutable in spirit. One file, one blob. You can associate the same blob with multiple application models as well. And if you want to do transformations of a given `Blob`, the idea is that you'll simply create a new one, rather than attempt to mutate the existing one (though of course you can delete the previous version later if you don't need it). diff --git a/activesupport/README.rdoc b/activesupport/README.rdoc index c56e63fa85..c2df6d73b2 100644 --- a/activesupport/README.rdoc +++ b/activesupport/README.rdoc @@ -15,7 +15,7 @@ The latest version of Active Support can be installed with RubyGems: Source code can be downloaded as part of the Rails project on GitHub: -* https://github.com/rails/rails/tree/master/activesupport +* https://github.com/rails/rails/tree/main/activesupport == License diff --git a/guides/source/4_0_release_notes.md b/guides/source/4_0_release_notes.md index 1caf066a10..15c628a502 100644 --- a/guides/source/4_0_release_notes.md +++ b/guides/source/4_0_release_notes.md @@ -234,11 +234,11 @@ Please refer to the [Changelog](https://github.com/rails/rails/blob/4-0-stable/a The method `change_table` is also reversible, as long as its block doesn't call `remove`, `change` or `change_default` * New method `reversible` makes it possible to specify code to be run when migrating up or down. - See the [Guide on Migration](https://github.com/rails/rails/blob/master/guides/source/active_record_migrations.md#using-reversible) + See the [Guide on Migration](https://github.com/rails/rails/blob/main/guides/source/active_record_migrations.md#using-reversible) * New method `revert` will revert a whole migration or the given block. If migrating down, the given migration / block is run normally. - See the [Guide on Migration](https://github.com/rails/rails/blob/master/guides/source/active_record_migrations.md#reverting-previous-migrations) + See the [Guide on Migration](https://github.com/rails/rails/blob/main/guides/source/active_record_migrations.md#reverting-previous-migrations) * Adds PostgreSQL array type support. Any datatype can be used to create an array column, with full migration and schema dumper support. diff --git a/guides/source/6_1_release_notes.md b/guides/source/6_1_release_notes.md index ff09d80e5d..965d945129 100644 --- a/guides/source/6_1_release_notes.md +++ b/guides/source/6_1_release_notes.md @@ -185,7 +185,7 @@ Please refer to the [Changelog][action-mailer] for detailed changes. ### Removals -* Remove deprecated `ActionMailer::Base.receive` in favor of [Action Mailbox](https://github.com/rails/rails/tree/master/actionmailbox). +* Remove deprecated `ActionMailer::Base.receive` in favor of [Action Mailbox](https://github.com/rails/rails/tree/main/actionmailbox). ### Deprecations @@ -458,16 +458,16 @@ See the for the many people who spent many hours making Rails, the stable and robust framework it is. Kudos to all of them. -[railties]: https://github.com/rails/rails/blob/master/railties/CHANGELOG.md -[action-pack]: https://github.com/rails/rails/blob/master/actionpack/CHANGELOG.md -[action-view]: https://github.com/rails/rails/blob/master/actionview/CHANGELOG.md -[action-mailer]: https://github.com/rails/rails/blob/master/actionmailer/CHANGELOG.md -[action-cable]: https://github.com/rails/rails/blob/master/actioncable/CHANGELOG.md -[active-record]: https://github.com/rails/rails/blob/master/activerecord/CHANGELOG.md -[active-storage]: https://github.com/rails/rails/blob/master/activestorage/CHANGELOG.md -[active-model]: https://github.com/rails/rails/blob/master/activemodel/CHANGELOG.md -[active-support]: https://github.com/rails/rails/blob/master/activesupport/CHANGELOG.md -[active-job]: https://github.com/rails/rails/blob/master/activejob/CHANGELOG.md -[action-text]: https://github.com/rails/rails/blob/master/actiontext/CHANGELOG.md -[action-mailbox]: https://github.com/rails/rails/blob/master/actionmailbox/CHANGELOG.md -[guides]: https://github.com/rails/rails/blob/master/guides/CHANGELOG.md +[railties]: https://github.com/rails/rails/blob/main/railties/CHANGELOG.md +[action-pack]: https://github.com/rails/rails/blob/main/actionpack/CHANGELOG.md +[action-view]: https://github.com/rails/rails/blob/main/actionview/CHANGELOG.md +[action-mailer]: https://github.com/rails/rails/blob/main/actionmailer/CHANGELOG.md +[action-cable]: https://github.com/rails/rails/blob/main/actioncable/CHANGELOG.md +[active-record]: https://github.com/rails/rails/blob/main/activerecord/CHANGELOG.md +[active-storage]: https://github.com/rails/rails/blob/main/activestorage/CHANGELOG.md +[active-model]: https://github.com/rails/rails/blob/main/activemodel/CHANGELOG.md +[active-support]: https://github.com/rails/rails/blob/main/activesupport/CHANGELOG.md +[active-job]: https://github.com/rails/rails/blob/main/activejob/CHANGELOG.md +[action-text]: https://github.com/rails/rails/blob/main/actiontext/CHANGELOG.md +[action-mailbox]: https://github.com/rails/rails/blob/main/actionmailbox/CHANGELOG.md +[guides]: https://github.com/rails/rails/blob/main/guides/CHANGELOG.md diff --git a/guides/source/6_2_release_notes.md b/guides/source/6_2_release_notes.md index f3cfb56f0c..728f6f88f7 100644 --- a/guides/source/6_2_release_notes.md +++ b/guides/source/6_2_release_notes.md @@ -170,16 +170,16 @@ See the for the many people who spent many hours making Rails, the stable and robust framework it is. Kudos to all of them. -[railties]: https://github.com/rails/rails/blob/master/railties/CHANGELOG.md -[action-pack]: https://github.com/rails/rails/blob/master/actionpack/CHANGELOG.md -[action-view]: https://github.com/rails/rails/blob/master/actionview/CHANGELOG.md -[action-mailer]: https://github.com/rails/rails/blob/master/actionmailer/CHANGELOG.md -[action-cable]: https://github.com/rails/rails/blob/master/actioncable/CHANGELOG.md -[active-record]: https://github.com/rails/rails/blob/master/activerecord/CHANGELOG.md -[active-storage]: https://github.com/rails/rails/blob/master/activestorage/CHANGELOG.md -[active-model]: https://github.com/rails/rails/blob/master/activemodel/CHANGELOG.md -[active-support]: https://github.com/rails/rails/blob/master/activesupport/CHANGELOG.md -[active-job]: https://github.com/rails/rails/blob/master/activejob/CHANGELOG.md -[action-text]: https://github.com/rails/rails/blob/master/actiontext/CHANGELOG.md -[action-mailbox]: https://github.com/rails/rails/blob/master/actionmailbox/CHANGELOG.md -[guides]: https://github.com/rails/rails/blob/master/guides/CHANGELOG.md +[railties]: https://github.com/rails/rails/blob/main/railties/CHANGELOG.md +[action-pack]: https://github.com/rails/rails/blob/main/actionpack/CHANGELOG.md +[action-view]: https://github.com/rails/rails/blob/main/actionview/CHANGELOG.md +[action-mailer]: https://github.com/rails/rails/blob/main/actionmailer/CHANGELOG.md +[action-cable]: https://github.com/rails/rails/blob/main/actioncable/CHANGELOG.md +[active-record]: https://github.com/rails/rails/blob/main/activerecord/CHANGELOG.md +[active-storage]: https://github.com/rails/rails/blob/main/activestorage/CHANGELOG.md +[active-model]: https://github.com/rails/rails/blob/main/activemodel/CHANGELOG.md +[active-support]: https://github.com/rails/rails/blob/main/activesupport/CHANGELOG.md +[active-job]: https://github.com/rails/rails/blob/main/activejob/CHANGELOG.md +[action-text]: https://github.com/rails/rails/blob/main/actiontext/CHANGELOG.md +[action-mailbox]: https://github.com/rails/rails/blob/main/actionmailbox/CHANGELOG.md +[guides]: https://github.com/rails/rails/blob/main/guides/CHANGELOG.md diff --git a/guides/source/action_mailer_basics.md b/guides/source/action_mailer_basics.md index 8be71f6258..2f3da94944 100644 --- a/guides/source/action_mailer_basics.md +++ b/guides/source/action_mailer_basics.md @@ -608,7 +608,7 @@ URL helper. <%= user_url(@user, host: 'example.com') %> ``` -NOTE: non-`GET` links require [rails-ujs](https://github.com/rails/rails/blob/master/actionview/app/assets/javascripts) or +NOTE: non-`GET` links require [rails-ujs](https://github.com/rails/rails/blob/main/actionview/app/assets/javascripts) or [jQuery UJS](https://github.com/rails/jquery-ujs), and won't work in mailer templates. They will result in normal `GET` requests. diff --git a/guides/source/active_storage_overview.md b/guides/source/active_storage_overview.md index 26d5fba6d8..4ed259c2e2 100644 --- a/guides/source/active_storage_overview.md +++ b/guides/source/active_storage_overview.md @@ -483,7 +483,7 @@ accessible by default. Anyone that knows the blob URL will be able to download i even if a `before_action` in your `ApplicationController` would otherwise require a login. If your files require a higher level of protection consider implementing your own authenticated -[`ActiveStorage::Blobs::RedirectController`](https://github.com/rails/rails/blob/master/activestorage/app/controllers/active_storage/blobs/redirect_controller.rb) and [`ActiveStorage::Representations::RedirectController`](https://github.com/rails/rails/blob/master/activestorage/app/controllers/active_storage/representations/redirect_controller.rb). +[`ActiveStorage::Blobs::RedirectController`](https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/blobs/redirect_controller.rb) and [`ActiveStorage::Representations::RedirectController`](https://github.com/rails/rails/blob/main/activestorage/app/controllers/active_storage/representations/redirect_controller.rb). To create a download link, use the `rails_blob_{path|url}` helper. Using this helper allows you to set the disposition. @@ -1006,5 +1006,5 @@ Implementing Support for Other Cloud Services If you need to support a cloud service other than these, you will need to implement the Service. Each service extends -[`ActiveStorage::Service`](https://github.com/rails/rails/blob/master/activestorage/lib/active_storage/service.rb) +[`ActiveStorage::Service`](https://github.com/rails/rails/blob/main/activestorage/lib/active_storage/service.rb) by implementing the methods necessary to upload and download files to the cloud. diff --git a/guides/source/contributing_to_ruby_on_rails.md b/guides/source/contributing_to_ruby_on_rails.md index dcaf691d51..4dc0314251 100644 --- a/guides/source/contributing_to_ruby_on_rails.md +++ b/guides/source/contributing_to_ruby_on_rails.md @@ -16,7 +16,7 @@ After reading this guide, you will know: Ruby on Rails is not "someone else's framework". Over the years, thousands of people have contributed to Ruby on Rails ranging from a single character to massive architectural changes or significant documentation - all with the goal of making Ruby on Rails better for everyone. Even if you don't feel up to writing code or documentation yet, there are a variety of other ways that you can contribute, from reporting issues to testing patches. As mentioned in [Rails' -README](https://github.com/rails/rails/blob/master/README.md), everyone interacting in Rails and its sub-projects' codebases, issue trackers, chat rooms, and mailing lists is expected to follow the Rails [code of conduct](https://rubyonrails.org/conduct/). +README](https://github.com/rails/rails/blob/main/README.md), everyone interacting in Rails and its sub-projects' codebases, issue trackers, chat rooms, and mailing lists is expected to follow the Rails [code of conduct](https://rubyonrails.org/conduct/). -------------------------------------------------------------------------------- @@ -39,13 +39,13 @@ Then, don't get your hopes up! Unless you have a "Code Red, Mission Critical, th Having a way to reproduce your issue will be very helpful for others to help confirm, investigate, and ultimately fix your issue. You can do this by providing an executable test case. To make this process easier, we have prepared several bug report templates for you to use as a starting point: -* Template for Active Record (models, database) issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_master.rb) -* Template for testing Active Record (migration) issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_migrations_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_migrations_master.rb) -* Template for Action Pack (controllers, routing) issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_controller_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_controller_master.rb) -* Template for Active Job issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_job_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_job_master.rb) -* Template for Active Storage issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_storage_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_storage_master.rb) -* Template for Action Mailbox issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_mailbox_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_mailbox_master.rb) -* Generic template for other issues: [gem](https://github.com/rails/rails/blob/master/guides/bug_report_templates/generic_gem.rb) / [master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/generic_master.rb) +* Template for Active Record (models, database) issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_gem.rb) / [master](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_master.rb) +* Template for testing Active Record (migration) issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_migrations_gem.rb) / [master](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_migrations_master.rb) +* Template for Action Pack (controllers, routing) issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_controller_gem.rb) / [master](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_controller_master.rb) +* Template for Active Job issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_job_gem.rb) / [master](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_job_master.rb) +* Template for Active Storage issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_storage_gem.rb) / [master](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_storage_master.rb) +* Template for Action Mailbox issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_mailbox_gem.rb) / [master](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_mailbox_master.rb) +* Generic template for other issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/generic_gem.rb) / [master](https://github.com/rails/rails/blob/main/guides/bug_report_templates/generic_master.rb) These templates include the boilerplate code to set up a test case against either a released version of Rails (`*_gem.rb`) or edge Rails (`*_master.rb`). @@ -136,7 +136,7 @@ learn about Ruby on Rails, and the API, which serves as a reference. You can help improve the Rails guides or the API reference by making them more coherent, consistent, or readable, adding missing information, correcting factual errors, fixing typos, or bringing them up to date with the latest edge Rails. -To do so, make changes to Rails guides source files (located [here](https://github.com/rails/rails/tree/master/guides/source) on GitHub) or RDoc comments in source code. Then open a pull request to apply your +To do so, make changes to Rails guides source files (located [here](https://github.com/rails/rails/tree/main/guides/source) on GitHub) or RDoc comments in source code. Then open a pull request to apply your changes to the master branch. When working with documentation, please take into account the [API Documentation Guidelines](api_documentation_guidelines.html) and the [Ruby on Rails Guides Guidelines](ruby_on_rails_guides_guidelines.html). @@ -291,7 +291,7 @@ Therefore, you should test your change against a list of representative scenarios. Ideally, they should be based on real-world scenarios extracted from production applications. -You can use the [benchmark template](https://github.com/rails/rails/blob/master/guides/bug_report_templates/benchmark.rb) +You can use the [benchmark template](https://github.com/rails/rails/blob/main/guides/bug_report_templates/benchmark.rb) as a starting point. It includes the boilerplate code to set up a benchmark using the [benchmark-ips](https://github.com/evanphx/benchmark-ips) gem. The template is designed for testing relatively self-contained changes that can be diff --git a/guides/source/i18n.md b/guides/source/i18n.md index 29ab45b2e4..1c5f4e0206 100644 --- a/guides/source/i18n.md +++ b/guides/source/i18n.md @@ -103,7 +103,7 @@ en: hello: "Hello world" ``` -This means, that in the `:en` locale, the key _hello_ will map to the _Hello world_ string. Every string inside Rails is internationalized in this way, see for instance Active Model validation messages in the [`activemodel/lib/active_model/locale/en.yml`](https://github.com/rails/rails/blob/master/activemodel/lib/active_model/locale/en.yml) file or time and date formats in the [`activesupport/lib/active_support/locale/en.yml`](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml) file. You can use YAML or standard Ruby Hashes to store translations in the default (Simple) backend. +This means, that in the `:en` locale, the key _hello_ will map to the _Hello world_ string. Every string inside Rails is internationalized in this way, see for instance Active Model validation messages in the [`activemodel/lib/active_model/locale/en.yml`](https://github.com/rails/rails/blob/main/activemodel/lib/active_model/locale/en.yml) file or time and date formats in the [`activesupport/lib/active_support/locale/en.yml`](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/locale/en.yml) file. You can use YAML or standard Ruby Hashes to store translations in the default (Simple) backend. The I18n library will use **English** as a **default locale**, i.e. if a different locale is not set, `:en` will be used for looking up translations. @@ -1043,23 +1043,23 @@ Rails uses fixed strings and other localizations, such as format strings and oth #### Action View Helper Methods -* `distance_of_time_in_words` translates and pluralizes its result and interpolates the number of seconds, minutes, hours, and so on. See [datetime.distance_in_words](https://github.com/rails/rails/blob/master/actionview/lib/action_view/locale/en.yml#L4) translations. +* `distance_of_time_in_words` translates and pluralizes its result and interpolates the number of seconds, minutes, hours, and so on. See [datetime.distance_in_words](https://github.com/rails/rails/blob/main/actionview/lib/action_view/locale/en.yml#L4) translations. -* `datetime_select` and `select_month` use translated month names for populating the resulting select tag. See [date.month_names](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L15) for translations. `datetime_select` also looks up the order option from [date.order](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L18) (unless you pass the option explicitly). All date selection helpers translate the prompt using the translations in the [datetime.prompts](https://github.com/rails/rails/blob/master/actionview/lib/action_view/locale/en.yml#L39) scope if applicable. +* `datetime_select` and `select_month` use translated month names for populating the resulting select tag. See [date.month_names](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/locale/en.yml#L15) for translations. `datetime_select` also looks up the order option from [date.order](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/locale/en.yml#L18) (unless you pass the option explicitly). All date selection helpers translate the prompt using the translations in the [datetime.prompts](https://github.com/rails/rails/blob/main/actionview/lib/action_view/locale/en.yml#L39) scope if applicable. -* The `number_to_currency`, `number_with_precision`, `number_to_percentage`, `number_with_delimiter`, and `number_to_human_size` helpers use the number format settings located in the [number](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L37) scope. +* The `number_to_currency`, `number_with_precision`, `number_to_percentage`, `number_with_delimiter`, and `number_to_human_size` helpers use the number format settings located in the [number](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/locale/en.yml#L37) scope. #### Active Model Methods -* `model_name.human` and `human_attribute_name` use translations for model names and attribute names if available in the [activerecord.models](https://github.com/rails/rails/blob/master/activerecord/lib/active_record/locale/en.yml#L36) scope. They also support translations for inherited class names (e.g. for use with STI) as explained above in "Error message scopes". +* `model_name.human` and `human_attribute_name` use translations for model names and attribute names if available in the [activerecord.models](https://github.com/rails/rails/blob/main/activerecord/lib/active_record/locale/en.yml#L36) scope. They also support translations for inherited class names (e.g. for use with STI) as explained above in "Error message scopes". * `ActiveModel::Errors#generate_message` (which is used by Active Model validations but may also be used manually) uses `model_name.human` and `human_attribute_name` (see above). It also translates the error message and supports translations for inherited class names as explained above in "Error message scopes". -* `ActiveModel::Errors#full_messages` prepends the attribute name to the error message using a separator that will be looked up from [errors.format](https://github.com/rails/rails/blob/master/activemodel/lib/active_model/locale/en.yml#L4) (and which defaults to `"%{attribute} %{message}"`). +* `ActiveModel::Errors#full_messages` prepends the attribute name to the error message using a separator that will be looked up from [errors.format](https://github.com/rails/rails/blob/main/activemodel/lib/active_model/locale/en.yml#L4) (and which defaults to `"%{attribute} %{message}"`). #### Active Support Methods -* `Array#to_sentence` uses format settings as given in the [support.array](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L33) scope. +* `Array#to_sentence` uses format settings as given in the [support.array](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/locale/en.yml#L33) scope. How to Store your Custom Translations ------------------------------------- diff --git a/guides/source/security.md b/guides/source/security.md index 48e35736f1..84674173ec 100644 --- a/guides/source/security.md +++ b/guides/source/security.md @@ -299,7 +299,7 @@ protect_from_forgery with: :exception This will include a security token in all forms and Ajax requests generated by Rails. If the security token doesn't match what was expected, an exception will be thrown. -NOTE: By default, Rails includes an [unobtrusive scripting adapter](https://github.com/rails/rails/blob/master/actionview/app/assets/javascripts), +NOTE: By default, Rails includes an [unobtrusive scripting adapter](https://github.com/rails/rails/blob/main/actionview/app/assets/javascripts), which adds a header called `X-CSRF-Token` with the security token on every non-GET Ajax call. Without this header, non-GET Ajax requests won't be accepted by Rails. When using another library to make Ajax calls, it is necessary to add the security diff --git a/guides/source/working_with_javascript_in_rails.md b/guides/source/working_with_javascript_in_rails.md index 24c77dd45b..e95a08974c 100644 --- a/guides/source/working_with_javascript_in_rails.md +++ b/guides/source/working_with_javascript_in_rails.md @@ -159,7 +159,7 @@ Because of Unobtrusive JavaScript, the Rails "Ajax helpers" are actually in two parts: the JavaScript half and the Ruby half. Unless you have disabled the Asset Pipeline, -[rails-ujs](https://github.com/rails/rails/tree/master/actionview/app/assets/javascripts) +[rails-ujs](https://github.com/rails/rails/tree/main/actionview/app/assets/javascripts) provides the JavaScript half, and the regular Ruby view helpers add appropriate tags to your DOM. @@ -562,6 +562,6 @@ Other Resources Here are some helpful links to help you learn even more: -* [rails-ujs wiki](https://github.com/rails/rails/tree/master/actionview/app/assets/javascripts) +* [rails-ujs wiki](https://github.com/rails/rails/tree/main/actionview/app/assets/javascripts) * [Railscasts: Unobtrusive JavaScript](http://railscasts.com/episodes/205-unobtrusive-javascript) * [Railscasts: Turbolinks](http://railscasts.com/episodes/390-turbolinks) diff --git a/railties/README.rdoc b/railties/README.rdoc index 26404743c4..13270dd424 100644 --- a/railties/README.rdoc +++ b/railties/README.rdoc @@ -17,7 +17,7 @@ The latest version of Railties can be installed with RubyGems: Source code can be downloaded as part of the Rails project on GitHub -* https://github.com/rails/rails/tree/master/railties +* https://github.com/rails/rails/tree/main/railties == License From 8afc9875f6bc273c63cc555d0606db1329455af5 Mon Sep 17 00:00:00 2001 From: benhayehudi Date: Sat, 16 Jan 2021 22:07:02 +0200 Subject: [PATCH 3/3] resolve merge conflict --- guides/source/contributing_to_ruby_on_rails.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/guides/source/contributing_to_ruby_on_rails.md b/guides/source/contributing_to_ruby_on_rails.md index cfb59cd3c1..9ffdc275c8 100644 --- a/guides/source/contributing_to_ruby_on_rails.md +++ b/guides/source/contributing_to_ruby_on_rails.md @@ -39,7 +39,6 @@ Then, don't get your hopes up! Unless you have a "Code Red, Mission Critical, th Having a way to reproduce your issue will be very helpful for others to help confirm, investigate, and ultimately fix your issue. You can do this by providing an executable test case. To make this process easier, we have prepared several bug report templates for you to use as a starting point: -<<<<<<< HEAD * Template for Active Record (models, database) issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_master.rb) * Template for testing Active Record (migration) issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_migrations_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_migrations_master.rb) * Template for Action Pack (controllers, routing) issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_controller_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_controller_master.rb) @@ -47,15 +46,6 @@ Having a way to reproduce your issue will be very helpful for others to help con * Template for Active Storage issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_storage_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_storage_master.rb) * Template for Action Mailbox issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_mailbox_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_mailbox_master.rb) * Generic template for other issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/generic_gem.rb) / [main](https://github.com/rails/rails/blob/main/guides/bug_report_templates/generic_master.rb) -======= -* Template for Active Record (models, database) issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_gem.rb) / [master](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_master.rb) -* Template for testing Active Record (migration) issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_migrations_gem.rb) / [master](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_record_migrations_master.rb) -* Template for Action Pack (controllers, routing) issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_controller_gem.rb) / [master](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_controller_master.rb) -* Template for Active Job issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_job_gem.rb) / [master](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_job_master.rb) -* Template for Active Storage issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_storage_gem.rb) / [master](https://github.com/rails/rails/blob/main/guides/bug_report_templates/active_storage_master.rb) -* Template for Action Mailbox issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_mailbox_gem.rb) / [master](https://github.com/rails/rails/blob/main/guides/bug_report_templates/action_mailbox_master.rb) -* Generic template for other issues: [gem](https://github.com/rails/rails/blob/main/guides/bug_report_templates/generic_gem.rb) / [master](https://github.com/rails/rails/blob/main/guides/bug_report_templates/generic_master.rb) ->>>>>>> otherrep/bug/references-to-master-branch These templates include the boilerplate code to set up a test case against either a released version of Rails (`*_gem.rb`) or edge Rails (`*_master.rb`).