mko
mko

Reputation: 22064

what does the path that in red header area of every rails documentation pages use for?

I'm new to rails when I check the rails online documentation pages like this: http://api.rubyonrails.org/classes/ActiveRecord/Base.html

in the red header area

ActiveRecord::Base  
In: activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb: activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb: activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb: activerecord/lib/active_record/connection_adapters/mysql_adapter.rb: activerecord/lib/active_record/base.rb:

what does the path mean? Do them reference to the related source files?

Thanks

Upvotes: 0

Views: 35

Answers (1)

balu
balu

Reputation: 3689

In Ruby, modules or classes can be defined in several files.

file1.rb:

class Foo
  def method1
    :foo
  end
end

file2.rb:

class Foo
  def method2
    :foo
  end
end

interactive ruby console:

$ irb
> require 'file1'; require 'file2'
> foo = Foo.new
> foo.method1 => :foo
> foo.method2 => :foo

Those paths just list where the ActiveRecord::Base is defined.

Upvotes: 1

Related Questions