I have added into my routes file prefix value to each map.resources line. So it all looks like this:
map.resources :subjects, :path_prefix => ':company'
I have even added this line for default behavior
map.connect ':company/:controller/:action/:id'
which is not necessary (I believe) because all the routes are handled with resources method.
I fetch the :company param in my before_filter method in ApplicationController. Everything works. But.
Is it possible to change the behaviour of all *_path methods that it would set company value for all generated urls by default with the one taken from the url? To make it work perfectly I would have to add company value as param for each _path method. I believe it is possible to make it automatic.