Commit Graph

187 Commits

Author SHA1 Message Date
Akhil G Krishnan
04ba4fb94b Update the puma startup message 2024-01-01 11:38:05 +05:30
Jean Boussier
1320ff0a3e
Merge pull request #2 from zzak/bump-ruby-version_check
Remove Ruby version check
2023-12-31 09:04:16 +01:00
zzak
110a4e6abc
Remove Ruby version check
Also includes relevant docs, inspired by 6487836af8
2023-12-31 12:38:25 +09:00
Akhil G Krishnan
a0e2c79e74 Document --skip-rubocop rails command 2023-12-31 08:20:01 +05:30
Ricardo Elisiário
f9e21c5616
refactor: fix typo 2023-12-11 19:53:39 +00:00
Akhil G Krishnan
68d39cb1c8 Updated rails about guide content with latest data
requested changes updated
2023-11-13 00:11:59 +05:30
Akhil G Krishnan
41e86d4286 Updated the rails version in 7.1 to 7.2 in guide [skip ci] 2023-10-11 20:26:23 +05:30
Akhil G Krishnan
72fae17f92 Updated the rails version in 7.0 to 7.1 in guide [skip ci] 2023-10-11 19:45:22 +05:30
Rafael Mendonça França
fb6c6007d0
Development of Rails 7.2 starts now
🎉
2023-09-27 03:59:11 +00:00
Akhil G Krishnan
f4233f5bd0 [ci skip] Add --skip-dev-gems rails command line argument to the guide 2023-07-24 12:57:01 +05:30
Rafael Mendonça França
4d171a4bde
Merge pull request #47779 from zzak/mdl
Introduce markdownlint for guides
2023-03-29 15:33:41 -04:00
Petrik de Heus
e6884f8b96
Merge pull request #47610 from ghiculescu/less-rake
Mention "rake" less in guides
2023-03-28 18:58:41 +02:00
Petrik
f7204d8d35 Output generator usage on two lines
All other command usage uses two lines for "Usage: rails command".
This updates the usage of generators to do the same.
It also changes the command to `bin/rails`.
2023-03-27 20:47:04 +02:00
zzak
c3f2b545f8
Introduce markdownlint for guides
This is a follow up to rails#47186, this time for all markdown content.

[markdownlint](https://github.com/markdownlint/markdownlint) is an excellent tool, and I've found it very useful for finding issues in the guides.

Many of the rules are common style issues I'm correcting on PRs, so it will be nice to have that automated.

We should also be able to use the same config with our editors, so that errors show up in real-time 🙏 and will update the contributing docs once this gets merged with how to debug and use mdl appropriately.
2023-03-27 12:14:18 +09:00
zzak
dadf46de36
Add rubocop-md for linting guides snippets 2023-03-15 10:48:19 +09:00
Alex Ghiculescu
64e60e731a Mention "rake" less in guides
[This blog post](https://dev.to/youngbloodcyb/rake-junior-rails-review-13cc) is about the confusion between `bin/rake` and `bin/rails` commands. The two have mostly [been aliases since Rails 5](3d252a02ae (diff-f5ff9aa07f44111a79d56c09ec37d774b462d97aff68f32490c2e56e74c95783R162)), but this means there's all sorts of advice floating around the internet about which command to use. Is `rake db:migrate` the same as `bin/rails db:migrate`? I know that it is, but I can see why it's confusing for a first timer.

The blog post's suggestion was to have a section in the guides that introduces rake and talks about this distinction. I'm not sure about this. I think if we take up too much space too early in the guide discussing this, it risks confusing people even earlier. But if the advice is hidden away too much, nobody will find it.

Something I think we should do, though, is mention `rake` as little as possible in the guides. Mentions in upgrade guides and release notes are fine, but elsewhere we should avoid using it in places where `bin/rails` does an equivalent job. This PR removes a few `rake` mentions from the guides. Before doing this, I was expecting there to be a lot more, so this PR turned out to be a bit smaller than expected. Still, every little bit helps I think.
2023-03-09 10:14:51 -07:00
Carlos Antonio da Silva
7cf65bc335
Merge pull request #47557 from swanson/swanson/remove-macports
Remove references to MacPorts setup
2023-03-02 14:17:31 -03:00
Matt Swanson
6bd9ce40c1 Remove references to macports setup 2023-03-02 10:43:30 -05:00
Petrik
6e89ae2d2e Use infinitive form verb for all task descriptions
All the common rails commands and some extended commands use the
infinitive form for the verb in the description. This changes the
remaining tasks to use the infinitive form verb as well, for
consistency.

__Before__

```console
$ bin/rails --help
...
action_mailbox:install             Installs Action Mailbox and its dependencies
...
app:template                       Applies the template supplied by LOCATION=(/path/to/template) or URL
...
credentials:diff                   Enrolls/disenrolls in decrypted diffs of credentials using git
credentials:edit                   Opens the decrypted credentials in `$EDITOR` for editing
credentials:show                   Shows the decrypted credentials
db:create                          Creates the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use...
db:drop                            Drops the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use d...
...
db:fixtures:load                   Loads fixtures into the current environment's database
db:migrate                         Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)
db:migrate:down                    Runs the "down" for a given migration VERSION
db:migrate:redo                    Rolls back the database one migration and re-migrates up (options: STEP=x, VERSION=x)
db:migrate:up                      Runs the "up" for a given migration VERSION
db:prepare                         Runs setup if database does not exist, or runs migrations if it does
db:reset                           Drops and recreates all databases from their schema for the current environment and loads th...
db:rollback                        Rolls the schema back to the previous version (specify steps w/ STEP=n)
db:schema:cache:clear              Clears a db/schema_cache.yml file
db:schema:cache:dump               Creates a db/schema_cache.yml file
db:schema:dump                     Creates a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['...
db:schema:load                     Loads a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['SC...
db:seed                            Loads the seed data from db/seeds.rb
db:seed:replant                    Truncates tables of each database for current environment and loads the seeds
db:setup                           Creates all databases, loads all schemas, and initializes with the seed data (use db:reset t...
db:system:change                   Changes `config/database.yml` and your database gem to the target database
db:version                         Retrieves the current schema version number
destroy                            Removes code generated by `bin/rails generate`
dev:cache                          Toggles development mode caching on/off
encrypted:edit                     Opens the decrypted file in `$EDITOR` for editing
encrypted:show                     Shows the decrypted contents of the file
...
log:clear                          Truncates all/specified *.log files in log/ to zero bytes (specify which logs with LOGS=test...
middleware                         Prints out your Rack middleware stack
notes                              Shows comments in your code annotated with FIXME, OPTIMIZE, and TODO
...
routes                             Lists all the defined routes
runner                             Runs Ruby code in the context of your application
...
secrets:edit                       Opens the secrets in `$EDITOR` for editing
secrets:show                       Shows the decrypted secrets
...
tmp:create                         Creates tmp directories for cache, sockets, and pids
version                            Shows the Rails version
...
zeitwerk:check                     Checks project structure for Zeitwerk compatibility
```

__After__

```console
$ bin/rails --help
...
action_mailbox:install             Install Action Mailbox and its dependencies
...
app:template                       Apply the template supplied by LOCATION=(/path/to/template) or URL
...
credentials:diff                   Enrolls/disenrolls in decrypted diffs of credentials using git
credentials:edit                   Opens the decrypted credentials in `$EDITOR` for editing
credentials:show                   Shows the decrypted credentials
db:create                          Create the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use ...
db:drop                            Drop the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use db...
...
db:fixtures:load                   Load fixtures into the current environment's database
db:migrate                         Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)
db:migrate:down                    Run the "down" for a given migration VERSION
db:migrate:redo                    Roll back the database one migration and re-migrate up (options: STEP=x, VERSION=x)
db:migrate:status                  Display status of migrations
db:migrate:up                      Run the "up" for a given migration VERSION
db:prepare                         Run setup if database does not exist, or run migrations if it does
db:reset                           Drop and recreate all databases from their schema for the current environment and load the s...
db:rollback                        Roll the schema back to the previous version (specify steps w/ STEP=n)
db:schema:cache:clear              Clear a db/schema_cache.yml file
db:schema:cache:dump               Create a db/schema_cache.yml file
db:schema:dump                     Create a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['S...
db:schema:load                     Load a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['SCH...
db:seed                            Load the seed data from db/seeds.rb
db:seed:replant                    Truncate tables of each database for current environment and load the seeds
db:setup                           Create all databases, load all schemas, and initialize with the seed data (use db:reset to a...
db:system:change                   Change `config/database.yml` and your database gem to the target database
db:version                         Retrieve the current schema version number
destroy                            Remove code generated by `bin/rails generate`
dev:cache                          Toggle development mode caching on/off
encrypted:edit                     Open the decrypted file in `$EDITOR` for editing
encrypted:show                     Show the decrypted contents of the file
...
log:clear                          Truncate all/specified *.log files in log/ to zero bytes (specify which logs with LOGS=test...
middleware                         Print out your Rack middleware stack
notes                              Show comments in your code annotated with FIXME, OPTIMIZE, and TODO
...
routes                             List all the defined routes
runner                             Run Ruby code in the context of your application
...
secrets:edit                       Open the secrets in `$EDITOR` for editing
secrets:show                       Show the decrypted secrets
...
tmp:create                         Create tmp directories for cache, sockets, and pids
version                            Show the Rails version
...
zeitwerk:check                     Check project structure for Zeitwerk compatibility
```

Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
2023-02-01 22:43:04 +01:00
Petrik
fb3b8bdbfe Show usage example for rails --help
In 2a5c116f12c7716399f5da3fe788f7e23ae67c4c the `Usage:\n rails COMMAND`
was removed from the help USAGE file. The original PR
https://github.com/rails/rails/pull/27601 doesn't mention why this was
done, so I'm not sure if this was done by accident.

Most commands have help usages of the form:
```console
Usage:
  bin/rails notes [options]

....
```

...so it is more consistent to use this for help as well.
This also allows differentiating between `rails` outside application
directories and `bin/rails` inside application directories.
2023-01-13 13:46:25 +01:00
Petrik
ad0534bb4a Update Command Line guide examples [ci-skip]
The output of `rails -h` has been changed in: 9a6d380cf263acd21aecd7931486f9a3afadda4e
2023-01-13 13:25:24 +01:00
Abhay Nikam
1a03cd4913
[ci skip] Documents the --skip-docker rails command line argument (#46823) 2022-12-25 22:04:38 +05:30
Jonathan Hefner
a4dbfc0089 Use yaml code fence [ci-skip]
This changes a `bash` code fence with `cat` output to a `yaml` code
fence for proper YAML syntax highlighting.  This also fixes a typo in
the YAML content.
2022-11-15 13:57:15 -06:00
Missy Davies
d49a3abc01 Capitalize headings to match style guidelines
Fix all headings to follow Rails Guides Guidelines
2022-10-17 17:01:28 -10:00
Jonathan Hefner
9ac01c6a81 Use relative URLs for intra-guide links [ci-skip]
This ensures that the URLs are properly versioned when the guides are
rendered.
2022-08-05 21:36:18 -05:00
Emmanuel Hayford
d2050b2adc Use suggested version of note [ci-skip]
my_app seems to be what Rails docs use mostly. Changed it for some
consistency
2022-06-16 01:36:35 +02:00
Petrik
e5a06ecefe Update Command Line guide --database usage [ci-skip]
The current Command Line guide has an advanced section describing
specifying git as SCM and PostgreSQL as the database. This section is
easily overlooked: https://github.com/rails/rails/issues/44325

By moving whole "advanced" section under the `rails new` section, it's
easier to find. Also specifying the database is pretty common I guess
and not an "advanced" topic.

All mentions of the SCM option have been removed, as it seems to no
longer be an option and we always initialize with Git only.
2022-06-14 22:18:31 +02:00
Emmanuel Hayford
a3ffa9b908 Add info and fix command description [ci-skip] 2022-06-13 21:11:17 +02:00
Wilfried OLLIVIER
0f2a97f6ca Move rails new doc into a new header 2022-06-04 17:08:51 +02:00
Jonathan Hefner
73e0a9c749 Clarify scaffold generator explanation [ci-skip] 2022-02-13 13:07:51 -06:00
Ghouse Mohamed
680df32812 Added more skip options for rails command line documentation 2022-02-12 22:46:56 +05:30
Ghouse Mohamed
97bf34fdd5 Improve Rails 7 documentation for the command line and asset pipeline 2022-02-12 10:31:13 +05:30
Rafael Mendonça França
83d85b2207
Start Rails 7.1 development 2021-12-07 15:52:30 +00:00
Rafael Mendonça França
4ace047c91
Add back Rack::Runtime to the default middleware stack.
We were planning to remove this middleware because we thought it could
make easier to attacker to do a Time Attack. However, while
Rack::Runtime can indeed be used to know how long a request took, and
compare with other requests, it doesn't provide any information that
can't be found in the total time of the request as well.

Instead of removing the middleware, we decided to keep it, and direct
users to instead of removing it, use its information to uncover actions
that are vulnerable to Time Attack.

This reverts commit 127dd06df66552dd272eea7832f8bb205cf6fd01, reversing
changes made to 4354e3ae492e95934a6da4101556a05d20b9f897.
2021-09-15 18:37:34 -04:00
David Heinemeier Hansson
d5b9618da1
Remove default reliance on Sass and CSS generators (#43110)
* No benefit to having actiontext css as scss

* Update test

* Update docs

* No more css assets to be generated

New world, new CSS frameworks, new needs.

* SCSS is becoming optional

* Remove Sass as a default-on setting

But continue to make it easy to add.

* Update docs

* No longer used

* Update tests

* Update docs

* Update docs

* No longer used

* No longer by default

* Fix tests

* Promote Tailwind CSS as an alternative to Sass

* Fix test and copy task

* Update railties/lib/rails/generators/rails/app/templates/Gemfile.tt

Co-authored-by: Kevin Newton <kddnewton@gmail.com>

Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2021-08-26 13:40:25 +02:00
David Heinemeier Hansson
21c9732fae
Remove spring as a default installation option (#42997)
* Remove spring as a default installation option

Faster computers have meant that most apps won't see a big benefit from Spring on small to moderate size apps. Thus the pain of dealing with the occasional spring issue is no longer warranted by default.

* Errant end

* No longer an option

* Additional spring removals

* Pointer to docs is enough
2021-08-12 12:31:18 +02:00
Marc Anguera
51cebff059
Remove docs of now gone --skip-gemfile [skip ci]
Related to #42996.
Similar to 8d1b8e870c
2021-08-11 17:37:15 +02:00
David Heinemeier Hansson
8d1b8e870c Remove test and docs of now gone --skip-puma 2021-08-11 16:35:15 +02:00
David Heinemeier Hansson
e34300a921
Stop trying to configure listen by default on compatible platforms (#42985)
* Stop trying to configure listen by default on compatible platforms

Modern computers with SSDs don't see much/any benefit from having an evented file update watcher. Remove complexity by taking this spinning-drive concession out.

* Actually need listen for testing the opt-in

* Test no longer relevant
2021-08-11 15:18:43 +02:00
Aditya Pandit
72b62f392e Matched guide example with rails api docs [ci skip] 2021-05-01 13:18:45 +05:30
aphel
011180e56c
Document input format for multiple arguments 2021-04-15 05:47:03 +01:00
Hartley McGuire
7bfcf4b313 Remove Rack::Runtime and deprecate referencing it
Previous discussion: #38412, #38325, 37423e4, 24f9c03

- Rack::Runtime is replaced by FakeRuntime, which is a dummy middleware
  that just passes requests on and cannot be used in middleware operations
- Using Rack::Runtime in middleware operations (relative inserts, moves,
  etc.) throws a deprecation warning and uses FakeRuntime instead
- if an application adds Rack::Runtime explicitly (use, unshift, etc.),
  then the deprecation warning does not happen and FakeRuntime is
  ignored
- docs are updated to no longer reference Rack::Runtime
2021-04-12 14:31:12 -04:00
Rafael Mendonça França
6487836af8
Rails 7 requires Ruby 2.7 and prefer Ruby 3+
The code cleanup is comming in later commits but this
already remove support to Ruby < 2.7.
2021-02-04 16:34:53 +00:00
Jonathan Hefner
3c9d7a268f Use irb code fences where applicable [ci-skip]
Using `irb` code fences and the appropriate prompt syntax results in
better syntax highlighting.
2020-11-01 16:29:18 -06:00
Eileen M. Uchitelle
9a36b50b84
Merge branch 'master' into combine-structure-and-schema-tasks 2020-08-17 08:47:51 -04:00
Abhay Nikam
d747b53172 Document the --database/--db option for multiple database Rails application [skip ci] 2020-08-11 21:37:37 +05:30
fatkodima
5488686851 Combine and deprecate rails db:structure:{dump,load} tasks into rails db:schema:{dump,load} 2020-08-03 19:08:41 +03:00
Jonathan Hefner
481035fba0 Use bash code fences and prompts for shell code [ci skip]
Follow-up to #39594, which added CSS in order to select shell commands
sans prompts on triple-click.

This commit adds several bash code fences and prompts where they were
missing, and removes a few where they were inappropriate.
2020-06-13 19:27:30 -05:00
Petrik
2b09948637 Replace 'Stubs out' with 'Generates' in generator USAGE's [ci skip]
Generators generate things, but what is meant by 'Stubbing out' might
confuse beginners and non-native English speakers.
While generated tests are stubs that should have an implementation, a
generated model is a valid model that doesn't require any changes.
2020-06-03 08:51:47 +02:00
Haroon Ahmed
6504e97561 update global rails commands to bundled rails i.e. bin/rails 2020-04-11 17:32:26 +01:00