Views on Create/Update/Delete actions #169
Replies: 3 comments 8 replies
|
Why are you using PATCH and not using PUT? I don't know the difference here. |
|
Perhaps I was trying to do something that maybe shouldn't be supported when I noticed this and made the comment. I made a "create" view that was supposed to accept the newly created widget and simply said "You have successfully created widget: <widget_name>." It just took me a minute to realize why I was seeing "Not Found" (b/c I hadn't made Index yet) |
|
Just playing around with bud... Personally I would allow each method its own view. If the should not have views I'd create a warning. The comment generated by I would like to have something like this: Defining method, path and view. Ofc sensible default values if omitted. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
@jfmario pointed out in the docs that the non-GET actions, e.g.
Cannot have views. They will redirect back to
IndexorShow, unless you setAcceptheader toapplication/json.This is following Rail's routing conventions that I find pretty good for mapping a domain to an API, despite there being some confusion around nested routes.
We'll need to decide if actions:
Either is possible, the can't would probably be an error, the shouldn't would probably allow views on creates, but is just considered a bad practice.
All reactions