Two possible fixes
1) Try to use optional in belongs_to statement
belongs_to :foo, :optional => true #it gives you urls for Bar without Foo
2) AA use Inherited_resources gem , try to customize belongs_to (by default it uses find by id)
Example from inherited_resources
belongs_to accepts several options to be able to configure the association. For example, if you want urls like "/projects/:project_title/tasks", you can customize how InheritedResources find your projects:
class TasksController < InheritedResources::Base
belongs_to :project, :finder => :find_by_title!, :param => :project_title
end
So this should help
belongs_to :foo , :finder => :find_by_resource_key!