mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-05 23:44:32 +00:00
Update cheatsheets
This commit is contained in:
25
tldr/rails-console
Normal file
25
tldr/rails-console
Normal file
@@ -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: <https://guides.rubyonrails.org/command_line.html#bin-rails-console>.
|
||||
|
||||
- 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`
|
||||
29
tldr/rails-new
Normal file
29
tldr/rails-new
Normal file
@@ -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: <https://guides.rubyonrails.org/command_line.html#rails-new>.
|
||||
|
||||
- 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`
|
||||
29
tldr/rails-server
Normal file
29
tldr/rails-server
Normal file
@@ -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: <https://guides.rubyonrails.org/command_line.html#bin-rails-server>.
|
||||
|
||||
- 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`
|
||||
Reference in New Issue
Block a user