W5D3 - Rails Routes
Rails Lite Continued!
We made some more progress on our own version of Rails today. My Rails Lite can now accept url's with query strings, and parse the parameters into an arbitrarily deeply nested hash! That is, if the query string contains "user[street][number]=12", then the code translates that to user: { street: { number: 12 } }, and can decide how to render a page based on that information.
Routes
I also gave Rails Lite the ability to create routes. It will read commands given by a developer using Rails Lite, accepting different http methods (GET, POST, etc.), paths (/users/new, etc.), and controller actions (index, create, etc.). Based on that information, it will instantiate a new controller to call the action, which will in turn render a page. This involved more metaprogramming. I am gradually getting a better feel for this metaprogramming stuff (see ActiveRecord Lite Day)












