I've been using Rails to teach web application development at the
University level since 2005. The very first thing we do in the section
about routing is entirely zero out the routes.rb file to be an empty
routing block.

This comes from several semesters of working with default routes
available and having nearly half the class end up with a false
association that urls *must* match controller/action names. Even after
explaining REST, building custom routes, and working with
map.resources a significant number of students would cling to their
first understanding of routing (the defaults) and never move away from
them.

The magic of map.resources can suffer from the same problem: students
understand its outcome (urls of a certain pattern) earlier than its
intended use (urls for a certain type of resource) and often abuse
map.resources just to get urls they want (e.g. map.resource :about_us
just to get a url "/about_us").


To stray slightly off topic:
Initially we taught Rails using all the handy shortcuts used to make
development faster and have slowly moved towards a more hands on,
fundamentals approach to instruction in the framework. Topics we
typically don't cover until the students understand the patterns
behind them:
  * default routes (we never explain this)
  * map.resource/s (mentioned after they've been hand-crafting the
REST pattern in routes)
  * generators (mentioned in passing after they've created files they
need by hand)
  * form builders, form helpers (we never cover these at all).
  * ERB (we've had more luck with haml)

When I mention this at conferences I get reactions I'd expect from
insulting someone's mother but the abstraction of form builders or
generators are great for rapid development but a pedagogic nightmare
(and ERB is a typing error minefield without helpers).

-Trek

On Tue, Feb 16, 2010 at 6:36 AM, Thomas R. Koll <[email protected]> wrote:
>
> Am 15.02.2010 um 23:54 schrieb ahe:
>>
>> When you generate a new Rails 3 project, "basic" routes are disabled
>> by default because this line is commented out :
>> # match ':controller(/:action(/:id(.:format)))'
>>
>> Is it really necessary?
>> What about people learning Rails who are not familiar with REST?
>
>
> The default routes are the first thing that have to go in all my apps.
>
> A beginner will most likely use a generator for his controllers
> and that will create proper resource routes.
>
> ciao, tom
> --
> Thomas R. "TomK32" Koll
> just a geek trying to change the world
> http://ananasblau.com || http://photostre.am || http://photolog.at
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Core" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-core?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to