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

Allow custom_enpoint method and route to be different #240

Open
hildevestol opened this issue Feb 24, 2017 · 1 comment
Open

Allow custom_enpoint method and route to be different #240

hildevestol opened this issue Feb 24, 2017 · 1 comment

Comments

@hildevestol
Copy link

hildevestol commented Feb 24, 2017

Scenario:

I have to custom_endpoints with the same name. One for PUT and one for DELETE
I cannot fint a way to use custom_endpoints for this, because custom_endpoints sets the path/route and method to the same.

custom_endpoint :cancellation, on: :member, request_method: :put
custom_endpoint :cancellation, on: :member, request_method: :delete

calling MyObject.cancellation will result in a delte request and I have not found a way of calling the put request.
There should be another param to differ between path and method name

custom_endpoint :cancel, path: :cancellation, request_method: :put
custom_endpoint :reactivate, path: :cancellation, request_method: :put

allowing MyObject.cancel and MyObject.reactivate using the correct path and request_method.

@skierkowski
Copy link

+1
In my case I would like to create the method apply but the path to be /actions/apply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants