Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v6.0.0) is shown here.
These similar methods exist in v7.1.3.2:
member()
public
To add a member
route, add a member
block into the resource
block:
resources :photos do
member do
get 'preview'
end
end
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.
Show source
def member
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) { yield }
}
else
path_scope(parent_resource.member_scope) { yield }
end
end
end