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.
This is my routes file:
ActionController::Routing::Routes.draw do |map|
map.home '', :controller => 'assets', :action => 'index'
map.resources :assets, :categories, :incomings, :outgoings, :users
map.signin '/signin', :controller => 'application', :action =>
map.signout '/signout', :controller => 'application', :action =>
map.signup '/signup', :controller => 'application', :action =>
Any help would be greatly appreciated.