Forum: Ruby on Rails How to read rails documentation

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6661ef9d747db3af8896cd94959d717d?d=identicon&s=25 Paul Barry (Guest)
on 2006-04-04 20:30
(Received via mailing list)
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

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/Mi...

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.
119af50160cabfe1fb6f2f05f5018c64?d=identicon&s=25 James Ludlow (Guest)
on 2006-04-04 20:36
(Received via mailing list)
On 4/4/06, Paul Barry <mail@paulbarry.com> 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/

On the left, under Methods, click on "create_table."  All of the
options are explained.

-- James
6661ef9d747db3af8896cd94959d717d?d=identicon&s=25 Paul Barry (Guest)
on 2006-04-04 20:55
(Received via mailing list)
wow, that's easy enough.  Now how about the scripts, like
script/generate
scaffold, how do I find out the details for that?
3dd4b52a0946bd698b1d1635a46ea3a3?d=identicon&s=25 François Beausoleil (fbeausoleil)
on 2006-04-04 21:23
(Received via mailing list)
2006/4/4, Paul Barry <mail@paulbarry.com>:
> 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 !
6661ef9d747db3af8896cd94959d717d?d=identicon&s=25 Paul Barry (Guest)
on 2006-04-04 23:23
(Received via mailing list)
nice, thanks
This topic is locked and can not be replied to.