Does anyone have nested routes working with the facebook_resources
method?
My routes.rb has:
map.facebook_resources :users do |users|
users.facebook_resources :images
users.facebook_resources :connections
end
but user_connections_url won''t generate.
"rake routes" gives me:
new_user POST /users/new
{:action=>"new", :controller=>"users"}
users POST /users/index
{:action=>"index", :controller=>"users"}
show_user POST /users/:id/show
{:action=>"show", :controller=>"users"}
create_user POST /users/create
{:action=>"create", :controller=>"users"}
edit_user POST /users/:id/edit
{:action=>"edit", :controller=>"users"}
update_user POST /users/:id/update
{:action=>"update", :controller=>"users"}
destroy_user POST /users/:id/destroy
{:action=>"destroy", :controller=>"users"}
/:controller/:action/:id.:format
/:controller/:action/:id
/
{:action=>"index", :controller=>"main"}
And that''s it.
Am I missing something obvious here or does the current implementation
just not work for nested routes?
Thanks everyone!
P.S. I''m new. Love facebooker. I was fighting with rFacebook for a
week and I found facebooker and it was love at first POST request.
-----
BJ Clark
the science department
bjclark at scidept.com
www.scidept.com
Hi BJ,
My suggestion would be to do "rake routes". It will print out all the
routes that are dynamically generated for you. It is very helpful in
tracking things down.
In my app i ended up not even using the map.facebook_resources and it
worked great for me. I did however map some "top level" actions that
are convenient for the facebook app like this:
map.connect ''installed'', :controller =>
''users'', :action =>
''installed''
map.connect ''uninstalled'', :controller =>
''users'', :action =>
''uninstalled''
map.connect ''about'', :controller =>
''users'', :action =>
''about''
map.connect ''help'', :controller =>
''users'', :action =>
''help''
map.connect ''privacy'', :controller =>
''users'', :action =>
''privacy''
Hope that helps,
Mark
On Jan 3, 2008, at 9:26 PM, BJ Clark wrote:
> Does anyone have nested routes working with the facebook_resources
> method?
> My routes.rb has:
>
> map.facebook_resources :users do |users|
> users.facebook_resources :images
> users.facebook_resources :connections
> end
>
> but user_connections_url won''t generate.
> "rake routes" gives me:
> new_user POST /users/new
> {:action=>"new", :controller=>"users"}
> users POST /users/index
> {:action=>"index", :controller=>"users"}
> show_user POST /users/:id/show
> {:action=>"show", :controller=>"users"}
> create_user POST /users/create
> {:action=>"create", :controller=>"users"}
> edit_user POST /users/:id/edit
> {:action=>"edit", :controller=>"users"}
> update_user POST /users/:id/update
> {:action=>"update", :controller=>"users"}
> destroy_user POST /users/:id/destroy
> {:action=>"destroy", :controller=>"users"}
> /:controller/:action/:id.:format
> /:controller/:action/:id
> /
> {:action=>"index", :controller=>"main"}
>
> And that''s it.
> Am I missing something obvious here or does the current implementation
> just not work for nested routes?
> Thanks everyone!
>
> P.S. I''m new. Love facebooker. I was fighting with rFacebook for a
> week and I found facebooker and it was love at first POST request.
> -----
> BJ Clark
> the science department
> bjclark at scidept.com
> www.scidept.com
>
>
> _______________________________________________
> Facebooker-talk mailing list
> Facebooker-talk at rubyforge.org
> http://rubyforge.org/mailman/listinfo/facebooker-talk
BJ- facebook_resources doesn''t work with nested routes yet. It will most likely be replaced with with just map.resources. I suggest just creating named routes manually for now. Shane On Jan 4, 2008 3:26 AM, BJ Clark <bjclark at scidept.com> wrote:> Does anyone have nested routes working with the facebook_resources > method? > My routes.rb has: > > map.facebook_resources :users do |users| > users.facebook_resources :images > users.facebook_resources :connections > end > > but user_connections_url won''t generate. > "rake routes" gives me: > new_user POST /users/new > {:action=>"new", :controller=>"users"} > users POST /users/index > {:action=>"index", :controller=>"users"} > show_user POST /users/:id/show > {:action=>"show", :controller=>"users"} > create_user POST /users/create > {:action=>"create", :controller=>"users"} > edit_user POST /users/:id/edit > {:action=>"edit", :controller=>"users"} > update_user POST /users/:id/update > {:action=>"update", :controller=>"users"} > destroy_user POST /users/:id/destroy > {:action=>"destroy", :controller=>"users"} > /:controller/:action/:id.:format > /:controller/:action/:id > / > {:action=>"index", :controller=>"main"} > > And that''s it. > Am I missing something obvious here or does the current implementation > just not work for nested routes? > Thanks everyone! > > P.S. I''m new. Love facebooker. I was fighting with rFacebook for a > week and I found facebooker and it was love at first POST request. > ----- > BJ Clark > the science department > bjclark at scidept.com > www.scidept.com > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk >-- http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com