aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/active_support_instrumentation.md25
-rw-r--r--guides/source/asset_pipeline.md23
-rw-r--r--guides/source/command_line.md27
-rw-r--r--guides/source/contributing_to_ruby_on_rails.md2
-rw-r--r--guides/source/documents.yaml5
5 files changed, 60 insertions, 22 deletions
diff --git a/guides/source/active_support_instrumentation.md b/guides/source/active_support_instrumentation.md
index e5ed283c45..4868b00bbe 100644
--- a/guides/source/active_support_instrumentation.md
+++ b/guides/source/active_support_instrumentation.md
@@ -545,6 +545,14 @@ Active Storage
| `:key` | Secure token |
| `:service` | Name of the service |
+### service_download_chunk.active_storage
+
+| Key | Value |
+| ------------ | ------------------------------- |
+| `:key` | Secure token |
+| `:service` | Name of the service |
+| `:range` | Byte range attempted to be read |
+
### service_download.active_storage
| Key | Value |
@@ -582,6 +590,23 @@ Active Storage
| `:service` | Name of the service |
| `:url` | Generated URL |
+### service_update_metadata.active_storage
+
+| Key | Value |
+| --------------- | ------------------------------ |
+| `:key` | Secure token |
+| `:service` | Name of the service |
+| `:content_type` | HTTP Content-Type field |
+| `:disposition` | HTTP Content-Disposition field |
+
+INFO. The only ActiveStorage service that provides this hook so far is GCS.
+
+### preview.active_storage
+
+| Key | Value |
+| ------------ | ------------------- |
+| `:key` | Secure token |
+
Railties
--------
diff --git a/guides/source/asset_pipeline.md b/guides/source/asset_pipeline.md
index 454613e733..d853559440 100644
--- a/guides/source/asset_pipeline.md
+++ b/guides/source/asset_pipeline.md
@@ -33,13 +33,11 @@ passing the `--skip-sprockets` option.
rails new appname --skip-sprockets
```
-Rails automatically adds the `sass-rails`, `coffee-rails` and `uglifier`
-gems to your `Gemfile`, which are used by Sprockets for asset compression:
+Rails automatically adds the `sass-rails` gem to your `Gemfile`, which is used
+by Sprockets for asset compression:
```ruby
gem 'sass-rails'
-gem 'uglifier'
-gem 'coffee-rails'
```
Using the `--skip-sprockets` option will prevent Rails from adding
@@ -176,8 +174,7 @@ in `app/assets` are never served directly in production.
### Controller Specific Assets
-When you generate a scaffold or a controller, Rails also generates a JavaScript
-file (or CoffeeScript file if the `coffee-rails` gem is in the `Gemfile`) and a
+When you generate a scaffold or a controller, Rails also generates a
Cascading Style Sheet file (or SCSS file if `sass-rails` is in the `Gemfile`)
for that controller. Additionally, when generating a scaffold, Rails generates
the file `scaffolds.css` (or `scaffolds.scss` if `sass-rails` is in the
@@ -434,9 +431,8 @@ one file rather than many, the load time of pages can be greatly reduced because
the browser makes fewer requests. Compression also reduces file size, enabling
the browser to download them faster.
-
-For example, a new Rails application includes a default
-`app/assets/javascripts/application.js` file containing the following lines:
+For example, with a `app/assets/javascripts/application.js` file containing the
+following lines:
```js
// ...
@@ -476,8 +472,7 @@ which contains these lines:
*/
```
-Rails creates both `app/assets/javascripts/application.js` and
-`app/assets/stylesheets/application.css` regardless of whether the
+Rails create `app/assets/stylesheets/application.css` regardless of whether the
--skip-sprockets option is used when creating a new Rails application. This is
so you can easily add asset pipelining later if you like.
@@ -517,8 +512,7 @@ The file extensions used on an asset determine what preprocessing is applied.
When a controller or a scaffold is generated with the default Rails gemset, a
CoffeeScript file and a SCSS file are generated in place of a regular JavaScript
and CSS file. The example used before was a controller called "projects", which
-generated an `app/assets/javascripts/projects.coffee` and an
-`app/assets/stylesheets/projects.scss` file.
+generated an `app/assets/stylesheets/projects.scss` file.
In development mode, or if the asset pipeline is disabled, when these files are
requested they are processed by the processors provided by the `coffee-script`
@@ -1083,7 +1077,7 @@ Possible options for JavaScript compression are `:closure`, `:uglifier` and
`:yui`. These require the use of the `closure-compiler`, `uglifier` or
`yui-compressor` gems, respectively.
-The default `Gemfile` includes [uglifier](https://github.com/lautis/uglifier).
+Take the `uglifier` gem, for example.
This gem wraps [UglifyJS](https://github.com/mishoo/UglifyJS) (written for
NodeJS) in Ruby. It compresses your code by removing white space and comments,
shortening local variable names, and performing other micro-optimizations such
@@ -1230,4 +1224,3 @@ it as a preprocessor for your mime type.
```ruby
Sprockets.register_preprocessor 'text/css', AddComment
```
-
diff --git a/guides/source/command_line.md b/guides/source/command_line.md
index a83724f1bb..4ad143d105 100644
--- a/guides/source/command_line.md
+++ b/guides/source/command_line.md
@@ -257,7 +257,7 @@ We will set up a simple resource called "HighScore" that will keep track of our
```bash
$ rails generate scaffold HighScore game:string score:integer
invoke active_record
- create db/migrate/20130717151933_create_high_scores.rb
+ create db/migrate/20190416145729_create_high_scores.rb
create app/models/high_score.rb
invoke test_unit
create test/models/high_score_test.rb
@@ -275,20 +275,19 @@ $ rails generate scaffold HighScore game:string score:integer
create app/views/high_scores/_form.html.erb
invoke test_unit
create test/controllers/high_scores_controller_test.rb
+ create test/system/high_scores_test.rb
invoke helper
create app/helpers/high_scores_helper.rb
+ invoke test_unit
invoke jbuilder
create app/views/high_scores/index.json.jbuilder
create app/views/high_scores/show.json.jbuilder
- invoke test_unit
- create test/system/high_scores_test.rb
+ create app/views/high_scores/_high_score.json.jbuilder
invoke assets
- invoke coffee
- create app/assets/javascripts/high_scores.coffee
invoke scss
create app/assets/stylesheets/high_scores.scss
invoke scss
- identical app/assets/stylesheets/scaffolds.scss
+ create app/assets/stylesheets/scaffolds.scss
```
The generator checks that there exist the directories for models, controllers, helpers, layouts, functional and unit tests, stylesheets, creates the views, controller, model and database migration for HighScore (creating the `high_scores` table and fields), takes care of the route for the **resource**, and new tests for everything.
@@ -481,6 +480,22 @@ lib/school.rb:
* [ 17] [FIXME]
```
+#### Tags
+
+You can add more default tags to search for by using `config.annotations.register_tags`. It receives a list of tags.
+
+```ruby
+config.annotations.register_tags("DEPRECATEME", "TESTME")
+```
+
+```bash
+$ rails notes
+app/controllers/admin/users_controller.rb:
+ * [ 20] [TODO] do A/B testing on this
+ * [ 42] [TESTME] this needs more functional tests
+ * [132] [DEPRECATEME] ensure this method is deprecated in next release
+```
+
#### Directories
You can add more default directories to search from by using `config.annotations.register_directories`. It receives a list of directory names.
diff --git a/guides/source/contributing_to_ruby_on_rails.md b/guides/source/contributing_to_ruby_on_rails.md
index c33d523c0e..f86589bdf1 100644
--- a/guides/source/contributing_to_ruby_on_rails.md
+++ b/guides/source/contributing_to_ruby_on_rails.md
@@ -247,7 +247,7 @@ Rails follows a simple set of coding style conventions:
* Two spaces, no tabs (for indentation).
* No trailing whitespace. Blank lines should not have any spaces.
-* Indent after private/protected.
+* Indent and no blank line after private/protected.
* Use Ruby >= 1.9 syntax for hashes. Prefer `{ a: :b }` over `{ :a => :b }`.
* Prefer `&&`/`||` over `and`/`or`.
* Prefer class << self over self.method for class methods.
diff --git a/guides/source/documents.yaml b/guides/source/documents.yaml
index 25e4fdb4e6..1e67b2bce7 100644
--- a/guides/source/documents.yaml
+++ b/guides/source/documents.yaml
@@ -155,6 +155,11 @@
name: Using Rails for API-only Applications
url: api_app.html
description: This guide explains how to effectively use Rails to develop a JSON API application.
+ -
+ name: Active Record and PostgreSQL
+ work_in_progress: true
+ url: active_record_postgresql.html
+ description: This guide covers PostgreSQL specific usage of Active Record.
-
name: Extending Rails