Skip to content

Commit

Permalink
Typo fixes to various guides.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Gunderloy authored and Mike Gunderloy committed Nov 30, 2008
1 parent ce2eadb commit 2b0d345
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
6 changes: 3 additions & 3 deletions railties/doc/guides/source/association_basics.txt
Expand Up @@ -416,9 +416,9 @@ This declaration needs to be backed up by the proper foreign key declaration on
class CreateOrders < ActiveRecord::Migration class CreateOrders < ActiveRecord::Migration
def self.up def self.up
create_table :orders do |t| create_table :orders do |t|
t.order_date :datetime t.datetime :order_date
t.order_number :string t.string :order_number
t.customer_id :integer t.integer :customer_id
end end
end end


Expand Down
22 changes: 19 additions & 3 deletions railties/doc/guides/source/getting_started_with_rails.txt
Expand Up @@ -154,6 +154,13 @@ And if you're using PostgreSQL for data storage, run this command:
$ rails blog -d postgresql $ rails blog -d postgresql
------------------------------------------------------- -------------------------------------------------------


After you create the blog application, switch to its folder to continue work directly in that application:

[source, shell]
-------------------------------------------------------
$ cd blog
-------------------------------------------------------

In any case, Rails will create a folder in your working directory called +blog+. Open up that folder and explore its contents. Most of the work in this tutorial will happen in the +app/+ folder, but here's a basic rundown on the function of each folder that Rails creates in a new application by default: In any case, Rails will create a folder in your working directory called +blog+. Open up that folder and explore its contents. Most of the work in this tutorial will happen in the +app/+ folder, but here's a basic rundown on the function of each folder that Rails creates in a new application by default:


[grid="all"] [grid="all"]
Expand Down Expand Up @@ -239,6 +246,15 @@ development:


Change the username and password in the +development+ section as appropriate. Change the username and password in the +development+ section as appropriate.


==== Creating the Database

Now that you have your database configured, it's time to have Rails create an empty database for you. You can do this by running a rake command:

[source, shell]
-------------------------------------------------------
$ rake db:create
-------------------------------------------------------

== Hello, Rails! == Hello, Rails!


One of the traditional places to start with a new language is by getting some text up on screen quickly. To do that in Rails, you need to create at minimum a controller and a view. Fortunately, you can do that in a single command. Enter this command in your terminal: One of the traditional places to start with a new language is by getting some text up on screen quickly. To do that in Rails, you need to create at minimum a controller and a view. Fortunately, you can do that in a single command. Enter this command in your terminal:
Expand Down Expand Up @@ -370,15 +386,15 @@ end


If you were to translate that into words, it says something like: when this migration is run, create a table named +posts+ with two string columns (+name+ and +title+) and a text column (+content+), and generate timestamp fields to track record creation and updating. You can learn the detailed syntax for migrations in the link:../migrations.html[Rails Database Migrations] guide. If you were to translate that into words, it says something like: when this migration is run, create a table named +posts+ with two string columns (+name+ and +title+) and a text column (+content+), and generate timestamp fields to track record creation and updating. You can learn the detailed syntax for migrations in the link:../migrations.html[Rails Database Migrations] guide.


At this point, you need to do two things: create the database and run the migration. You can use rake commands at the terminal for both of those tasks: At this point, you can use a rake command to run the migration:


[source, shell] [source, shell]
------------------------------------------------------- -------------------------------------------------------
$ rake db:create $ rake db:create
$ rake db:migrate $ rake db:migrate
------------------------------------------------------- -------------------------------------------------------


NOTE: Because you're working in the development environment by default, both of these commands will apply to the database defined in the +development+ section of your +config/database.yml+ file. NOTE: Because you're working in the development environment by default, this command will apply to the database defined in the +development+ section of your +config/database.yml+ file.


=== Adding a Link === Adding a Link


Expand Down Expand Up @@ -748,7 +764,7 @@ At this point, it’s worth looking at some of the tools that Rails provides to


=== Using Partials to Eliminate View Duplication === Using Partials to Eliminate View Duplication


As you saw earlier, the scaffold-generated views for the +new+ and +edit+ actions are largely identical. You can pull the shared code out into a +partial+ template. This requires editing the new and edit views, and adding a new template: As you saw earlier, the scaffold-generated views for the +new+ and +edit+ actions are largely identical. You can pull the shared code out into a +partial+ template. This requires editing the new and edit views, and adding a new template. The new +_form.html.erb+ template should be saved in the same +app/views/posts+ folder as the files from which it is being extracted:


+new.html.erb+: +new.html.erb+:


Expand Down
6 changes: 3 additions & 3 deletions railties/doc/guides/source/routing_outside_in.txt
Expand Up @@ -738,7 +738,7 @@ You do not need to explicitly use the +:controller+ and +:action+ symbols within


[source, ruby] [source, ruby]
------------------------------------------------------- -------------------------------------------------------
map.connect 'photo/:id', :controller => 'photos', :action => 'show' map.connect 'photos/:id', :controller => 'photos', :action => 'show'
------------------------------------------------------- -------------------------------------------------------


With this route, an incoming URL of +/photos/12+ would be dispatched to the +show+ action within the +Photos+ controller. With this route, an incoming URL of +/photos/12+ would be dispatched to the +show+ action within the +Photos+ controller.
Expand All @@ -747,7 +747,7 @@ You an also define other defaults in a route by supplying a hash for the +:defau


[source, ruby] [source, ruby]
------------------------------------------------------- -------------------------------------------------------
map.connect 'photo/:id', :controller => 'photos', :action => 'show', :defaults => { :format => 'jpg' } map.connect 'photos/:id', :controller => 'photos', :action => 'show', :defaults => { :format => 'jpg' }
------------------------------------------------------- -------------------------------------------------------


With this route, an incoming URL of +photos/12+ would be dispatched to the +show+ action within the +Photos+ controller, and +params[:format]+ will be set to +jpg+. With this route, an incoming URL of +photos/12+ would be dispatched to the +show+ action within the +Photos+ controller, and +params[:format]+ will be set to +jpg+.
Expand Down Expand Up @@ -886,7 +886,7 @@ For better readability, you can specify an already-created route in your call to


[source, ruby] [source, ruby]
------------------------------------------------------- -------------------------------------------------------
map.index :controller => "pages", :action => "main" map.index 'index', :controller => "pages", :action => "main"
map.root :index map.root :index
------------------------------------------------------- -------------------------------------------------------


Expand Down

0 comments on commit 2b0d345

Please sign in to comment.