This will recognize /photos/1/preview with GET, and route to the
preview action of PhotosController. It will also create the
preview_photo_url and preview_photo_path helpers.
# File actionpack/lib/action_dispatch/routing/mapper.rb, line 1532
def member(&block)
unless resource_scope?
raise ArgumentError, "can't use member outside resource(s) scope"
end
with_scope_level(:member) do
if shallow?
shallow_scope {
path_scope(parent_resource.member_scope, &block)
}
else
path_scope(parent_resource.member_scope, &block)
end
end
end