Answer the question
In order to leave comments, you need to log in
Rails g scaffold person creates a people controller. Why?
After executing:
$ rails generate scaffold person name:string description:text phone:string email:string
$ rails generate scaffold person name:string description:text phone:string email:string
invoke active_record
create db/migrate/20121027223223_create_people.rb
create app/models/person.rb
invoke test_unit
create test/unit/person_test.rb
create test/fixtures/people.yml
invoke resource_route
route resources :people
invoke scaffold_controller
create app/controllers/people_controller.rb
invoke erb
create app/views/people
create app/views/people/index.html.erb
create app/views/people/edit.html.erb
create app/views/people/show.html.erb
create app/views/people/new.html.erb
create app/views/people/_form.html.erb
invoke test_unit
create test/functional/people_controller_test.rb
invoke helper
create app/helpers/people_helper.rb
invoke test_unit
create test/unit/helpers/people_helper_test.rb
invoke assets
invoke coffee
create app/assets/javascripts/people.js.coffee
invoke scss
create app/assets/stylesheets/people.css.scss
invoke scss
identical app/assets/stylesheets/scaffolds.css.scss
Answer the question
In order to leave comments, you need to log in
This has to do with name generation and Rails naming conventions. He creates a model with a name in a single number, but a table in the plural. Because some words in the English language in the plural sound differently, Rails has a dictionary on this subject, which just describes such bundles. People is just part of it. There are others out there, so that's ok.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question