1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 15:18:01 +00:00

Add Generate A Rails App From The Main Branch as a Rails TIL

This commit is contained in:
jbranchaud
2024-09-09 11:57:10 -05:00
parent 25b5677260
commit 191c9d6d9d
2 changed files with 29 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
_1439 TILs and counting..._
_1440 TILs and counting..._
---
@@ -897,6 +897,7 @@ _1439 TILs and counting..._
- [Find Or Create A Record With FactoryBot](rails/find-or-create-a-record-with-factory-bot.md)
- [Find Records With Multiple Associated Records](rails/find-records-with-multiple-associated-records.md)
- [Force All Users To Sign Out](rails/force-all-users-to-sign-out.md)
- [Generate A Rails App From The Main Branch](rails/generate-a-rails-app-from-the-main-branch.md)
- [Generating And Executing SQL](rails/generating-and-executing-sql.md)
- [Get A Quick Approximate Count Of A Large Table](rails/get-a-quick-approximate-count-of-a-large-table.md)
- [Get ActiveRecord Attribute Directly From Database](rails/get-active-record-attribute-directly-from-database.md)

View File

@@ -0,0 +1,27 @@
# Generate A Rails App From The Main Branch
Typically you are going to want to generate a Rails app using some officially
released version of the framework. These releases have been thoroughly tested,
have received patches, and can guarantee a certain level of stability.
However, if you are wanting to try out the latest, unreleased features, you may
want to generate a fresh Rails app based off the current state of the `main`
branch of the `rails` repository.
To do this, add the `--main` flag:
```bash
$ rails new rails_app_on_main --main
```
Toward the top of your app's `Gemfile`, you'll see that `rails` is pointed to
the `main` branch of their repo:
```ruby
# Use main development branch of Rails
gem "rails", github: "rails/rails", branch: "main"
```
See `rails new --help` for more details
[source](https://x.com/gregmolnar/status/1832720168264286571)