> The tutorial I''ve just been following (the OnLamp one) seems to
think
> that if you have:
> a database table called ''recipes''
> then the model will be called ''recipe''
> the url will be ''recipe''
> and for the purposes of the generate script, it''s
''Recipe''
>
> On the other hand, ''generate scaffold Recipe'' seems to
think that the
> url will be plural, ''recipes'', and puts the templates
under
> view/recipes.
>
> Is this something that changed between versions? I feel there''s a
case
> for both, at least when it comes to urls, because
"recipe/10/show"
> follows nicely from "recipes/list" - but is probably too clever
by half.
>
> Is there any easy way to make my application plural-agnostic, and allow
> ''recipe'' or ''recipes'' in the url (short
of using mod_rewrite)?
Use routes.
map.connect ''recipe/:id/:action'', :controller =>
''recipes'', :action => :show
Personally, I tend to name my controllers after the function it''s
performing, not what model(s) it''s using.
--
rick
http://techno-weenie.net