title: Understanding Application.routes.draw source code
body: <p>A couple of months ago I started developing web apps with Rails. As with any new framework I use, as a step to further understanding it I’ve started to read the source code. Maybe it’s my relative recent learning of Ruby, but I’m having some troubles making sense of it.</p>
  
  <p>Today I decided to look into <code>Application.routes.draw</code> (from <code>routes.rb</code>) and from the <a href="http://api.rubyonrails.org/classes/ActionDispatch/Routing.html" rel="nofollow">ActionDispatch::Routing documentation</a> I found the <code>draw</code> method defined in <a href="https://github.com/rails/rails/blob/3-2-stable/actionpack/lib/action_dispatch/routing/route_set.rb" rel="nofollow">rails/actionpack/lib/action_dispatch/routing/route_set.rb</a> but I fail to see where in <code>Application.rb</code> (or <code>Engine.rb</code> or <code>Railtie.rb</code>) it comes into play. Additionally I don’t see where the <code>routes</code> method in <code>Application</code> is defined.</p>
  
  <p>Any answer or link greatly appreciated. Thanks in advance.</p>