Skip to content

Commit 191c9d6

Browse files
committed
Add Generate A Rails App From The Main Branch as a Rails TIL
1 parent 25b5677 commit 191c9d6

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
1010

1111
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
1212

13-
_1439 TILs and counting..._
13+
_1440 TILs and counting..._
1414

1515
---
1616

@@ -897,6 +897,7 @@ _1439 TILs and counting..._
897897
- [Find Or Create A Record With FactoryBot](rails/find-or-create-a-record-with-factory-bot.md)
898898
- [Find Records With Multiple Associated Records](rails/find-records-with-multiple-associated-records.md)
899899
- [Force All Users To Sign Out](rails/force-all-users-to-sign-out.md)
900+
- [Generate A Rails App From The Main Branch](rails/generate-a-rails-app-from-the-main-branch.md)
900901
- [Generating And Executing SQL](rails/generating-and-executing-sql.md)
901902
- [Get A Quick Approximate Count Of A Large Table](rails/get-a-quick-approximate-count-of-a-large-table.md)
902903
- [Get ActiveRecord Attribute Directly From Database](rails/get-active-record-attribute-directly-from-database.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Generate A Rails App From The Main Branch
2+
3+
Typically you are going to want to generate a Rails app using some officially
4+
released version of the framework. These releases have been thoroughly tested,
5+
have received patches, and can guarantee a certain level of stability.
6+
7+
However, if you are wanting to try out the latest, unreleased features, you may
8+
want to generate a fresh Rails app based off the current state of the `main`
9+
branch of the `rails` repository.
10+
11+
To do this, add the `--main` flag:
12+
13+
```bash
14+
$ rails new rails_app_on_main --main
15+
```
16+
17+
Toward the top of your app's `Gemfile`, you'll see that `rails` is pointed to
18+
the `main` branch of their repo:
19+
20+
```ruby
21+
# Use main development branch of Rails
22+
gem "rails", github: "rails/rails", branch: "main"
23+
```
24+
25+
See `rails new --help` for more details
26+
27+
[source](https://x.com/gregmolnar/status/1832720168264286571)

0 commit comments

Comments
 (0)