module ActionDispatch::Routing::Mapper::Resources

def member(&block)

preview_photo_url and preview_photo_path helpers.
preview action of +PhotosController+. It will also create the
This will recognize /photos/1/preview with GET, and route to the

end
end
get 'preview'
member do
resources :photos do

To add a member route, add a member block into the resource block:
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