views:

43

answers:

3

This is probably super basic but, well, I can't find it...

What's the best way to explore Rails from within the installation itself. Let me explain. I'm looking at some Migration code and curious what a symbol means. How/where do I look that up? In this case, specifically, i'm curious about :force => true and what it's doing but the more general 'how do I go about answering this for myself w/out SO or Googling?' is the bigger question...

class CreateHomes < ActiveRecord::Migration
  def self.up
    create_table :homes, :force => true do |t|
      t.column :name, :string
      t.column :city, :string
    # ...
    end
  end
end
A: 

I personally use APIdock for Rails docs due to it keeping track of deprecations, though it gets behind in versions sometimes. There may be another site that you end up liking better. There are several of them out there.

:force => true is an arg to create_table, which is documented here.

x1a4
A: 

If you freeze your rails application then you will have all rails code within your vendor/rails directory. So when you are curious or do not know about how something really works under the hood then just search into that directory.

If you are not interested in code and only in documentation then you can use various online resources or gemserver locally. However, there is a nice gem called bdoc that you can use to view all locally installed gem in pretty format. You can set it up using http://nasir.wordpress.com/2009/09/22/pretty-rdocs-for-local-gems

nas
+1  A: 

if you want to explore rails form your installation itself, perhaps you could use "gem server", it will open a local documentation server for your local gems

http://localhost:8808/

if you are looking for something about migrations (activerecord) for example, you'll have to access http://localhost:8808/doc_root/activerecord-2.3.8/rdoc/index.html

that's the easy way, or you could go into your gems directory and look the sources. (it's a nice thing to do sometimes)

vrsmn