Forum: Ruby on Rails scaffold_resource question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F207f57f77b2cada48f075b9c9ad6ea0?d=identicon&s=25 eugenia (Guest)
on 2007-06-13 04:41
(Received via mailing list)
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.)
This topic is locked and can not be replied to.