# Scaffold\_resource question

**URL:** <https://www.ruby-forum.com/t/scaffold-resource-question/106676>\
**Category:** Rails\
**Created:** [June 13, 2007, 4:41am UTC](https://www.ruby-forum.com/t/scaffold-resource-question/106676 "2007-06-13T04:41:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eugenia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/35a633/32.png) [@eugenia](https://www.ruby-forum.com/u/eugenia)\
**Post date:** [June 13, 2007, 4:41am UTC](https://www.ruby-forum.com/t/scaffold-resource-question/106676/1 "2007-06-13T04:41:07Z")

</div>

Could anyone enlighten me on using scaffold\_resource with a path  
component (for lack of a better term). I tried this:

ruby script/generate scaffold\_resource admin/user email:string

which sort of worked, except that this was inserted into routes.rb:

map.resources :users

which I had to change to:

map.resources :users, {:controller=\>“Admin::Users”, :custom\_path =\>  
‘/admin/users’}

and the controller was generated with an index method that set an  
instance variable of @admin\_users instead of @users.

Once I made those 2 changes, all seems well, but I wonder if there  
is a better approach? This is with Rails 1.2.3.

(FWIW what I’m really trying to do is partition the admin component  
into some separate URL space but I’m starting to think that idea might  
be fundamentally flawed.)
