Skip to content

Commit 2fea8e7

Browse files
committed
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.
1 parent 9fd8b33 commit 2fea8e7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

guides/source/rails_application_templates.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ gem "nokogiri"
6262

6363
Note that this method only adds the gem to the `Gemfile`; it does not install the gem.
6464

65+
You can also specify an exact version:
66+
67+
```ruby
68+
gem "nokogiri", "~> 1.16.4"
69+
```
70+
71+
And you can also add comments that will be added to the `Gemfile`:
72+
73+
```ruby
74+
gem "nokogiri", "~> 1.16.4", comment: "Add the nokogiri gem for XML parsing"
75+
```
76+
6577
### gem_group(*names, &block)
6678

6779
Wraps gem entries inside a group.

0 commit comments

Comments
 (0)