# How to read rails documentation

**URL:** <https://www.ruby-forum.com/t/how-to-read-rails-documentation/93564>\
**Category:** Rails\
**Created:** [April 4, 2006, 8:30pm UTC](https://www.ruby-forum.com/t/how-to-read-rails-documentation/93564 "2006-04-04T20:30:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [April 4, 2006, 8:30pm UTC](https://www.ruby-forum.com/t/how-to-read-rails-documentation/93564/1 "2006-04-04T20:30:38Z")

</div>

One of the criticism I have heard about rails is that the documentation  
is  
bad. I must admit I have a hard time trying to follow it and I wonder  
if  
anyone can shed some light on it for me. For example, I am looking at  
the  
schema.rb file generated and I noticed this line:

create\_table “accounts”, :force =\> true do |t|

I thought to myself, what does :force =\> true mean? So I went to the  
docs  
to look it up. I figured this is the best place to start:

[http://rubyonrails.org/api/classes/ActiveRecord/Schema.html](http://rubyonrails.org/api/classes/ActiveRecord/Schema.html)

On the page, no mention of the create\_table method (is it a method?).  
For  
those of us used to looking at JavaDocs, even if a method is inheirited  
from  
a parent object, the doc shows you that, and gives you a link right to  
the  
parent object where is it define. But ok, fine, I’ll check the parent:

[http://rubyonrails.org/api/classes/ActiveRecord/Migration.html](http://rubyonrails.org/api/classes/ActiveRecord/Migration.html)

create\_table is not listed under the methods. Is create\_table not a  
method? It is listed under “Available transformations”. What is a  
transformation? Anyway, here is what it has:

create\_table(name, options) - Creates a table called name and makes the  
table object available to a block that can then add columns to it,  
following  
the same format as add\_column. See example above. The options hash is  
for  
fragments like “DEFAULT CHARSET=UTF-8” that are appended to the create  
table  
definition.

Ok, so what are the available options, and how do I find out what they  
do?

> From looking at my schema.rb, force appears to be a valid boolean option,  
> but I have no way of knowing what effect it has. I’m actually not that  
> concerned about what effect force has, but more so just understanding  
> how  
> I’m supposed to read & understand the docs. I feel like as I work with  
> rails this kind of thing comes up all the time. There is some magic  
> method  
> that takes a hash of arguments and it is near impossible to trace down  
> what  
> the vaild options are.

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [April 4, 2006, 8:36pm UTC](https://www.ruby-forum.com/t/how-to-read-rails-documentation/93564/2 "2006-04-04T20:36:58Z")

</div>

On 4/4/06, Paul B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Ok, so what are the available options, and how do I find out what they do?  
> From looking at my schema.rb, force appears to be a valid boolean option,  
> but I have no way of knowing what effect it has. I’m actually not that  
> concerned about what effect force has, but more so just understanding how  
> I’m supposed to read & understand the docs. I feel like as I work with  
> rails this kind of thing comes up all the time. There is some magic method  
> that takes a hash of arguments and it is near impossible to trace down what  
> the vaild options are.

Start here: [http://api.rubyonrails.org/](http://api.rubyonrails.org/)

On the left, under Methods, click on “create\_table.” All of the  
options are explained.

– James

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [April 4, 2006, 8:55pm UTC](https://www.ruby-forum.com/t/how-to-read-rails-documentation/93564/3 "2006-04-04T20:55:18Z")

</div>

wow, that’s easy enough. Now how about the scripts, like  
script/generate  
scaffold, how do I find out the details for that?

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [April 4, 2006, 9:23pm UTC](https://www.ruby-forum.com/t/how-to-read-rails-documentation/93564/4 "2006-04-04T21:23:16Z")

</div>

2006/4/4, Paul B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> wow, that’s easy enough. Now how about the scripts, like script/generate  
> scaffold, how do I find out the details for that?

script/generate --help  
script/generate scaffold --help

Bye !

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [April 4, 2006, 11:23pm UTC](https://www.ruby-forum.com/t/how-to-read-rails-documentation/93564/5 "2006-04-04T23:23:53Z")

</div>

nice, thanks
