Merge pull request #51660 from westoque/add-more-gem-docs-in-app-templates-guide

[ci skip] Add more gem docs in Rails Application Templates guide

Added doc on how to add a gem with a specific version.
Added doc on how to add a comment.
This commit is contained in:
Carlos Antonio da Silva 2024-04-25 09:52:37 -03:00 committed by GitHub
commit da21c2e981
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions

View File

@ -62,6 +62,18 @@ gem "nokogiri"
Note that this method only adds the gem to the `Gemfile`; it does not install the gem.
You can also specify an exact version:
```ruby
gem "nokogiri", "~> 1.16.4"
```
And you can also add comments that will be added to the `Gemfile`:
```ruby
gem "nokogiri", "~> 1.16.4", comment: "Add the nokogiri gem for XML parsing"
```
### gem_group(*names, &block)
Wraps gem entries inside a group.