# Nested resources and ActiveResource

**URL:** <https://www.ruby-forum.com/t/nested-resources-and-activeresource/146184>\
**Category:** Rails\
**Created:** [August 18, 2008, 8:39pm UTC](https://www.ruby-forum.com/t/nested-resources-and-activeresource/146184 "2008-08-18T20:39:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jawosis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f04885/32.png) [@jawosis](https://www.ruby-forum.com/u/jawosis)\
**Post date:** [August 18, 2008, 8:39pm UTC](https://www.ruby-forum.com/t/nested-resources-and-activeresource/146184/1 "2008-08-18T20:39:06Z")

</div>

On the server application I have a admin controller

[http://127.0.0.1:3000/admin/clients](http://127.0.0.1:3000/admin/clients)

class Admin::ClientsController \< ApplicationController  
before\_filter :authorize  
.  
.  
.

and this in my routes.rb:

map.namespace :admin do |admin|  
admin.resources :clients  
end

On the client site:

class Client \< ActiveResource::Base  
self.site = ‘[http://127.0.0.1:3000/admin](http://127.0.0.1:3000/admin)’  
self.user = ‘1’  
self.password = ‘1’  
end

What do I have to add on the client site to access the server?  
I just added

map.namespace :admin do |admin|  
admin.resources :clients  
end

in the routes.rb file - without success.

The client only needs to access everything under /admin on the server.

Thanx

---

<div class="post-metadata">

**Author:** ![jawosis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f04885/32.png) [@jawosis](https://www.ruby-forum.com/u/jawosis)\
**Post date:** [August 18, 2008, 8:43pm UTC](https://www.ruby-forum.com/t/nested-resources-and-activeresource/146184/2 "2008-08-18T20:43:12Z")

</div>

Am 18.08.2008 um 20:38 schrieb Jochen K.:

> ```
> self.site = 'http://127.0.0.1:3000/admin'
> 
> ```
> 
> in the routes.rb file - without success.
> 
> The client only needs to access everything under /admin on the server.

I just inspected the logfile:

Processing ClientsController#show (for 127.0.0.1 at 2008-08-18  
20:40:44) [GET]  
Session ID: a30a07484d1409d85cfb547c8694f496  
Parameters: {“format”=\>“xml”, “action”=\>“show”, “id”=\>“14”,  
“controller”=\>“admin/clients”}  
Asked for a remote server ? true, ENV[“FERRET\_USE\_LOCAL\_INDEX”] is  
nil, looks like we are not the server  
Will use remote index server which should be available at druby://  
localhost:9010

As I can see the client request is correct: controller"=\>"admin/clients  
It’s a bit confusing to me because of the missing “admin” in the  
browser’s url.

Ok.
