From 191c9d6d9dcf0b7eb52ff7807c2d5726de966d00 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Mon, 9 Sep 2024 11:57:10 -0500 Subject: [PATCH] Add Generate A Rails App From The Main Branch as a Rails TIL --- README.md | 3 ++- ...nerate-a-rails-app-from-the-main-branch.md | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 rails/generate-a-rails-app-from-the-main-branch.md diff --git a/README.md b/README.md index 891fb6e..0b3c5d7 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/rails/generate-a-rails-app-from-the-main-branch.md b/rails/generate-a-rails-app-from-the-main-branch.md new file mode 100644 index 0000000..a50efb1 --- /dev/null +++ b/rails/generate-a-rails-app-from-the-main-branch.md @@ -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)