I just remembered a major problem with the boss' suggestion: what if a
monkey's name collides with a controller action?
For example, is /monkeys/new a 'new' action on the whole collection, or a
'show' action on an individual monkey whose name is 'new'?
This pretty much *requires* IDs to be numeric, unless we accept a further
rejigging of URLs, such as
/monkeys/new
/monkeys/show/koko
/monkeys/edit/koko
or
/monkeys/*/new
/monkeys/koko
/monkeys/koko/edit
or even
/monkeys/new
/monkey/koko
/monkey/koko/edit
The first of these most closely retains the controller/action semantic, but
does not match the boss' URL spec, and it moves away fm the idea of an
object as a 'resource' like a file in a filesystem.
For another example of ambiguity, have a look at this bit of routing code,
and consider what happens if a monkey's name is 'edit':
next_level.match("/:id/edit").to_route.name(:"edit_#{route_singular_name}")
next_level.match("/:action/:id").to_route.name(:"custom_#{route_singular_name}")
(Unlikely? Well 'Edith' is a name, so I can imagine that 'Edit' might be a
name in some other languages :-)
I think these problems go away if semicolons are required for named actions,
i.e.
/monkeys;new
/monkeys/koko
/monkeys/koko;edit
but at the moment Merb and Rails accept both ; and /
Regards,
Brian.
_______________________________________________
Merb-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/merb-devel