4 ms·
One great starting point is ActiveSupport, specifically the core extensions: http://github.com/rails/rails/tree/master/activesupport/lib/active_support/core_ex
by shajith 16y ago
One great starting point is ActiveSupport, specifically the core extensions:
http://github.com/rails/rails/tree/master/activesupport/lib/active_support/core_ext/ http://github.com/rails/rails/tree/master/activesupport/lib/...
Though this library isn't really Rails-specific, it has a bunch of self-contained ruby files, good to learn about the style of doing things elsewhere in rails.
Examples: Array#uniq_by, String#pluralize, Numeric#hours, etc.
The Rails router, while considerably more complex than ActiveSupport, is also a self-contained chunk of code you can read:
http://github.com/rails/rails/tree/master/actionpack/lib/action_dispatch/routing/ http://github.com/rails/rails/tree/master/actionpack/lib/act...
Also: When reading Rails code (or any ruby library's code, for that matter), I've found that reading the specs first is very effective.