aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/command_line.md
diff options
context:
space:
mode:
authorsoartec-lab <info@soartec-lab.work>2019-04-17 00:05:10 +0900
committersoartec-lab <info@soartec-lab.work>2019-04-17 00:10:41 +0900
commitcdbb224a504c2ceab0414d76f477f38d38265aae (patch)
tree8f8c533eba164ab8fc3719053388d26c54437979 /guides/source/command_line.md
parentdc2d19b8bf693886bec520c1787166eb105c8567 (diff)
downloadrails-cdbb224a504c2ceab0414d76f477f38d38265aae.tar.gz
rails-cdbb224a504c2ceab0414d76f477f38d38265aae.tar.bz2
rails-cdbb224a504c2ceab0414d76f477f38d38265aae.zip
Update the generate command sample codes [skip ci]
Diffstat (limited to 'guides/source/command_line.md')
-rw-r--r--guides/source/command_line.md11
1 files changed, 5 insertions, 6 deletions
diff --git a/guides/source/command_line.md b/guides/source/command_line.md
index 0091271363..4ad143d105 100644
--- a/guides/source/command_line.md
+++ b/guides/source/command_line.md
@@ -257,7 +257,7 @@ We will set up a simple resource called "HighScore" that will keep track of our
```bash
$ rails generate scaffold HighScore game:string score:integer
invoke active_record
- create db/migrate/20130717151933_create_high_scores.rb
+ create db/migrate/20190416145729_create_high_scores.rb
create app/models/high_score.rb
invoke test_unit
create test/models/high_score_test.rb
@@ -275,20 +275,19 @@ $ rails generate scaffold HighScore game:string score:integer
create app/views/high_scores/_form.html.erb
invoke test_unit
create test/controllers/high_scores_controller_test.rb
+ create test/system/high_scores_test.rb
invoke helper
create app/helpers/high_scores_helper.rb
+ invoke test_unit
invoke jbuilder
create app/views/high_scores/index.json.jbuilder
create app/views/high_scores/show.json.jbuilder
- invoke test_unit
- create test/system/high_scores_test.rb
+ create app/views/high_scores/_high_score.json.jbuilder
invoke assets
- invoke coffee
- create app/assets/javascripts/high_scores.coffee
invoke scss
create app/assets/stylesheets/high_scores.scss
invoke scss
- identical app/assets/stylesheets/scaffolds.scss
+ create app/assets/stylesheets/scaffolds.scss
```
The generator checks that there exist the directories for models, controllers, helpers, layouts, functional and unit tests, stylesheets, creates the views, controller, model and database migration for HighScore (creating the `high_scores` table and fields), takes care of the route for the **resource**, and new tests for everything.