RESTful Routes Confusion

Hi All,

I'm working on a simple asset tracker application, but I've got a bit confused about routes. Briefly, in my application there are users who can have many assets, and each asset can have many incomings or outgoings. In turn, each incoming or outgoing is assigned a category. I'm using Edge Rails.

What I'd like to do is have every URL start with /users/<username>/ (e.g. /users/johntopley/assets/1). I know about :path_prefix and that you can nest resources, but I haven't been able to work out how to achieve what I'm after.

You need to nest the resources. It'll look like this:

map.resources :users do |u|   u.resources :assets end

I'm not too clear on what you meant by the incomings, outgoings, and categories, but you can continue to nest things if that's what you need. Don't know if this is what you'll need, but it's an example:

map.resources :users do |u|   u.resources :assets do |a|     a.resources :incomings, :outgoings, :categories   end end