1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

we don't have public/index.html anymore

This commit is contained in:
Akira Matsuda 2013-01-04 05:28:21 +09:00
parent 2161434d16
commit 02e422b64f

View file

@ -34,7 +34,6 @@ Rails templates API is very self explanatory and easy to understand. Here's an e
```ruby ```ruby
# template.rb # template.rb
run "rm public/index.html"
generate(:scaffold, "person name:string") generate(:scaffold, "person name:string")
route "root to: 'people#index'" route "root to: 'people#index'"
rake("db:migrate") rake("db:migrate")
@ -158,10 +157,10 @@ generate(:scaffold, "person", "name:string", "address:text", "age:number")
### run(command) ### run(command)
Executes an arbitrary command. Just like the backticks. Let's say you want to remove the `public/index.html` file: Executes an arbitrary command. Just like the backticks. Let's say you want to remove the `README.rdoc` file:
```ruby ```ruby
run "rm public/index.html" run "rm README.rdoc"
``` ```
### rake(command, options = {}) ### rake(command, options = {})
@ -180,7 +179,7 @@ rake "db:migrate", env: 'production'
### route(routing_code) ### route(routing_code)
Adds a routing entry to the `config/routes.rb` file. In above steps, we generated a person scaffold and also removed `public/index.html`. Now to make `PeopleController#index` as the default page for the application: Adds a routing entry to the `config/routes.rb` file. In above steps, we generated a person scaffold and also removed `README.rdoc`. Now to make `PeopleController#index` as the default page for the application:
```ruby ```ruby
route "root to: 'person#index'" route "root to: 'person#index'"