From 08ccd9d6a2b129eafbe4c7f6fffb5de15838a259 Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Mon, 27 Jan 2025 00:17:46 +0000 Subject: [PATCH] Update cheatsheets --- tldr/rails-console | 25 +++++++++++++++++++++++++ tldr/rails-new | 29 +++++++++++++++++++++++++++++ tldr/rails-server | 29 +++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 tldr/rails-console create mode 100644 tldr/rails-new create mode 100644 tldr/rails-server diff --git a/tldr/rails-console b/tldr/rails-console new file mode 100644 index 00000000..f745c0ac --- /dev/null +++ b/tldr/rails-console @@ -0,0 +1,25 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# rails console + +> Interact with a Rails application. +> More information: . + +- Start the Rails console: + +`rails console` + +- Start the Rails console and roll back all data modifications on exit: + +`rails console --sandbox` + +- Start the Rails console on a specified environment: + +`rails console --environment {{dev|test|production|...}}` + +- Display help: + +`rails console --help` diff --git a/tldr/rails-new b/tldr/rails-new new file mode 100644 index 00000000..5a8d38ee --- /dev/null +++ b/tldr/rails-new @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# rails new + +> Create a new Rails application. +> More information: . + +- Create a Rails app named `blog` in the current directory: + +`rails new blog` + +- Create a Rails app with API-only configuration: + +`rails new {{app_name}} --api` + +- Create a Rails app with `postgresql` as the database: + +`rails new {{app_name}} --database postgresql` + +- Create a Rails app without generating JavaScript files: + +`rails new {{app_name}} --skip-javascript` + +- Display help: + +`rails new --help` diff --git a/tldr/rails-server b/tldr/rails-server new file mode 100644 index 00000000..8139bea5 --- /dev/null +++ b/tldr/rails-server @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# rails server + +> Serve the Rails app in the current directory using the Puma web server, which comes bundled with Rails. +> More information: . + +- Run the web server: + +`rails server` + +- Run the web server on a specified port: + +`rails server --port {{port_number}}` + +- Run the web server on a specified IP address: + +`rails server --binding {{ip_address}}` + +- Run the web server on a specified environment: + +`rails server --environment {{environment}}` + +- Display help: + +`rails server --help`