Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give an unique name to "/$path/:id" element #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Mojolicious/Plugin/Restify.pm
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ sub register {

# generate "/$path/:id" element route with specific placeholder
my $element = $r->any("/$options->{placeholder}${path}_id")
->$requires_method($options->{over} => "${path}_id")->name($options->{route_name});
->$requires_method($options->{over} => "${path}_id")->name($options->{route_name} . '_id');

# Generate remaining CRUD routes for "/$path/:id", optionally creating a
# resource_lookup method for the resource $element.
Expand Down Expand Up @@ -355,7 +355,7 @@ to the name of a route condition. See L<Mojolicious::Routes/conditions>.
# /accounts * accounts
# +/ GET "accounts_list" Accounts::list
# +/ POST "accounts_create" Accounts::create
# +/:accounts_id * "accounts"
# +/:accounts_id * "accounts_id"
# +/ * "accounts_resource_lookup" Accounts::resource_lookup
# +/ DELETE "accounts_delete" Accounts::delete
# +/ GET "accounts_read" Accounts::read
Expand Down