diff options
author | Agis Anastasopoulos <corestudiosinc@gmail.com> | 2012-11-16 12:30:12 +0200 |
---|---|---|
committer | Agis Anastasopoulos <corestudiosinc@gmail.com> | 2012-11-16 12:30:12 +0200 |
commit | 8b178b3f480553bedc09683371df0aa87a421975 (patch) | |
tree | dc73d48c205067efbfdd4b5d4f7ee9848f5391e0 | |
parent | da7febdccbd2e0122006a4f5b4e8245e4ce4824e (diff) | |
download | rails-8b178b3f480553bedc09683371df0aa87a421975.tar.gz rails-8b178b3f480553bedc09683371df0aa87a421975.tar.bz2 rails-8b178b3f480553bedc09683371df0aa87a421975.zip |
Switch to 1.9 hash syntax (guides)
-rw-r--r-- | guides/source/rails_application_templates.md | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/guides/source/rails_application_templates.md b/guides/source/rails_application_templates.md index 20944ab258..0f2c987328 100644 --- a/guides/source/rails_application_templates.md +++ b/guides/source/rails_application_templates.md @@ -36,12 +36,12 @@ Rails templates API is very self explanatory and easy to understand. Here's an e # template.rb run "rm public/index.html" generate(:scaffold, "person name:string") -route "root :to => 'people#index'" +route "root to: 'people#index'" rake("db:migrate") git :init -git :add => "." -git :commit => %Q{ -m 'Initial commit' } +git add: "." +git commit: %Q{ -m 'Initial commit' } ``` The following sections outlines the primary methods provided by the API: @@ -92,7 +92,7 @@ Adds a line inside the `Application` class for `config/application.rb`. If options `:env` is specified, the line is appended to the corresponding file in `config/environments`. ```ruby -environment 'config.action_mailer.default_url_options = { :host => 'http://yourwebsite.example.com' }, :env => 'production' +environment 'config.action_mailer.default_url_options = {host: 'http://yourwebsite.example.com'}, env: 'production' ``` A block can be used in place of the `data` argument. @@ -175,7 +175,7 @@ rake "db:migrate" You can also run rake tasks with a different Rails environment: ```ruby -rake "db:migrate", :env => 'production' +rake "db:migrate", env: 'production' ``` ### route(routing_code) @@ -183,7 +183,7 @@ rake "db:migrate", :env => 'production' 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: ```ruby -route "root :to => 'person#index'" +route "root to: 'person#index'" ``` ### inside(dir) @@ -225,6 +225,6 @@ Rails templates let you run any git command: ```ruby git :init -git :add => "." -git :commit => "-a -m 'Initial commit'" +git add: "." +git commit: "-a -m 'Initial commit'" ``` |