On Apr 28, 12:33 pm, Kevin Monceaux <ke...@rawfeddogs.net> wrote:
>
> Actually, I think I just found the trick for Rails 3 in section 2.5 of
> the routing guide - Singular Resources.  It looks like RESTful routes
> tailored to my preferences are as simple as:
>
>       resource :recipe, :path => "Recipe"
>
>       match 'Recipes' => 'recipes#index', :as => :recipes, :via => :get
>
> I had tried using singular resources before but mistakenly typed
> resources instead of resource.  

On Apr 28, 12:33 pm, Kevin Monceaux <ke...@rawfeddogs.net> wrote:
> Actually, I think I just found the trick for Rails 3 in section 2.5 of
> the routing guide - Singular Resources.  It looks like RESTful routes
> tailored to my preferences are as simple as:
>
>       resource :recipe, :path => "Recipe"
>
>       match 'Recipes' => 'recipes#index', :as => :recipes, :via => :get
>
> I had tried using singular resources before but mistakenly typed
> resources instead of resource.  
>

Hmm, mapping a singular resource should expose routes that don't
accept an ID, which isn't really what you want; in other words there
should be /recipe which points to the singular recipe in the system,
but in reality you have multiple recipes and want to take an ID.  I'm
not sure what that match line is doing so perhaps that's patching
things up, but I'd be worried you'll hit issues like recipe_path won't
expect an ID (since its a singular route).  Although experimentation
is the king, so if its working go with it; if you hit ~unexpected~
issues then this might be the cause.

2c,
\Peter

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to