def nest_path_within_parent(path, params)
      return path unless params_include_parent_resource_id?(params)
      params.symbolize_keys!
      parent_resource = parent_resource_name(params)
      parent_id       = params.delete(parent_resource_param(params)).try(:to_s)
      File.join(*[parent_resource, parent_id, path].compact).to_s
    end
def nest_path_within_parent(path, params)
      return path unless params_include_parent_resource_id?(params)
      params.symbolize_keys!
      parent_resource = parent_resource_name(params)
      parent_id       = params.delete(parent_resource_param(params)).try(:to_s)
      File.join(*[parent_resource, parent_id, path].compact).to_s
    end
Nest a given resource path within a parent resource.

 path   - A String representing an API resource path.
 params - A Hash of params to send to the API.

 Examples

   nest_path_within_parent("bags/1", {user_id: "123"}) # => /users/123/bags/1

 Returns String