routes.rb
map.namespace :admin do |admin|
admin.resources :cupcakes
end
rake routes
cupcakes GET /cupcakes
formatted_cupcakes GET /cupcakes.:format
POST /cupcakes
POST /cupcakes.:format
That said, what the heck goes here:
form_for(:cupcake, @cupcake, xxx_url) # ???
Calling create_admin_cupcake_url yields…
undefined local variable or method ‘create_admin_cupcake_url’
Additionally, calling form_for(@cupcake) yields…
undefined method ‘cupcake_path’
Finally, I’ve also tried…
form_for(:cupcake, @cupcake, admin_cupcake_url, :method => :put)
Which points to this URL:
/admin/cupcakes/1/edit
And gives me this view:
Unknown action
No action responded to 1
Routing and URL helpers (what do I use when?) have been the biggest
barrier to creating a RESTful app.
I’ve watched the Railscasts video and read the 2.0 release notes, and
yes, the new stuff sure looks tasty, but it’s useless if I can’t get it
to work.