Forum: Ruby on Rails how to know objects' methods?

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.
55fc6a0d723d521d5177cce3bb80c866?d=identicon&s=25 John Smith (john1234)
on 2007-07-19 22:05
Hi,

I'm discovering Ruby on Rails and I'm limited with the fact that I don't
know which methods are available on the different objects provided by
the framework.

For example I use the following code to create my table:
    create_table :my_table do |t|
    t.column "title", :string
    end
I know that the column method exists for this object because I saw some
examples on the Net ... How can I know all the methods available for
this object (table object I guess?).

Thanks for any help. I presume it is a very basic question but I didn't
find the answer in the Ruby on Rails tutorials.

John
55fc6a0d723d521d5177cce3bb80c866?d=identicon&s=25 John Smith (john1234)
on 2007-07-19 22:13
I have in fact the answer to my question: http://api.rubyonrails.org/
I will now spend a lot of time on it!

John
Ae82cad40a0caca9c932d45c7a9eb3cd?d=identicon&s=25 Michael Glaesemann (Guest)
on 2007-07-19 22:19
(Received via mailing list)
On Jul 19, 2007, at 15:05 , John Smith wrote:

> I'm discovering Ruby on Rails and I'm limited with the fact that I
> don't
> know which methods are available on the different objects provided by
> the framework.

You can find this information via couple of methods:

1) the Rails documentation: http://api.rubyonrails.org/
2) use the #methods and #instances_methods methods on any object.
These methods return arrays of the available methods.

I think 1) is your best bet.

Michael Glaesemann
grzm seespotcode net
This topic is locked and can not be replied to.