Specifically, examining the source code of the Rails framework/active
record/ action pack/etc.
I have read AWDR and Ruby For Rails. That plus being modest apps has
helped provide a foundation.
While I know that reading the source code is the ideal way to learn and
I have scanned some, I am not yet strong enough to be able to do so
efficiently.
As such a book or a tutorial could help speed up my ability to
understand the Rails source (for instance, the last chapter of Ruby for
Rails).
Any pointers on-line or off would be appreciated.
Thanks,
John
--
Posted via http://www.ruby-forum.com/.
>
> I am looking for a book or tutorials that go more in depth on Rails
> internals.
>
> Specifically, examining the source code of the Rails framework/active
> record/ action pack/etc.
>
> I have read AWDR and Ruby For Rails. That plus being modest apps has
> helped provide a foundation.
>
> While I know that reading the source code is the ideal way to learn
> and
> I have scanned some, I am not yet strong enough to be able to do so
> efficiently.
>
>
> As such a book or a tutorial could help speed up my ability to
> understand the Rails source (for instance, the last chapter of Ruby
> for
> Rails).
>
I don't know of any such book, but a big problem with it would that it
would very quickly become obsolete. Books etc... have enough trouble
staying on top of the externally visible (ie api etc...) changes, and
internal changes happen even more often. You can learn a lot though by
just stepping through it with a debugger (or just mentally, assuming
you can keep in your head enough of the current state). Pick some
specific bit of functionality and follow it all the way through. It
should get easier as you get more familiar with the source.
Fred
> I am looking for a book or tutorials that go more in depth on Rails
> internals.
>
> Specifically, examining the source code of the Rails framework/active
> record/ action pack/etc.
>
> I have read AWDR and Ruby For Rails. That plus being modest apps has
> helped provide a foundation.
>
> While I know that reading the source code is the ideal way to learn
> and
> I have scanned some, I am not yet strong enough to be able to do so
> efficiently.
>
>
> As such a book or a tutorial could help speed up my ability to
> understand the Rails source (for instance, the last chapter of Ruby
> for
> Rails).
+1 to the other two replies.
I've done talks about Rails internals for 1.1 and 2.x and they were
based on code walkthroughs on some particular revision and help from
rails-core to understand why some things were done that way. The last
one from November 2007 is online:
http://www.hashref.com/talks/rails-desde-el-codigo-2007/index.html
It's Spanish but it is mostly code.
-- fxn
That's what I did in that last chapter -- basically stalking
#belongs_to through the source code. The source definitely does change
a lot over time, so mainly one wants to learn techniques for how to
navigate it, rather than trying to master or memorize every particular
of it. (At least, my brain is better at the learning to navigate thing
:-) It can be daunting but with a little guidance people usually end
up discovering that lots of it is much more accessible than they'd
thought.
David
--
Training for 2008!
Ruby on Rails training by David A. Black/Ruby Power and Light, LLC:
* Intro to Rails, New York, NY, February 4-7 2008
* Advancing With Rails, New York, NY, February 11-14 2008
Hosted by Exceed Education. See http://www.rubypal.com for details!
Specifically I know his routing walkthrough was really good.
--Jeremy
--
http://www.jeremymcanally.com/
My books:
Ruby in Practice
http://www.manning.com/mcanally/
My free Ruby e-book
http://www.humblelittlerubybook.com/
My blogs:
http://www.mrneighborly.com/
http://www.rubyinpractice.com/
For Rails specifically, there is 1 chapter that explains how the adapter
pattern can be used to enhance convention over configuration.
Using the debugger, when reached a debug point you set, rails
execution pauses and you can see what value each variable has, how the
frame stack is, etc.
To do that, in Rails 2.0.2, just write 'debugger' in your source code
wherever you want to insert a break point, then start the web server
with 'script/server -u'
In Rails 1.2.x, you also have to write
require 'ruby-debug'
at the end of config/environments/development.rb
while starting the web server with 'script/server'
Good luck!
> Using the debugger, when reached a debug point you set, rails execution
> pauses and you can see what value each variable has, how the frame stack
> is, etc.
>
> To do that, in Rails 2.0.2, just write 'debugger' in your source code
> wherever you want to insert a break point, then start the web server
> with 'script/server -u'
Thanks :)
-Thufir