A user wants to perform a task that is destructive, so a POST request
is issued.
The controller action determines that another task before the first
task can be completed, so the original request is stored, and the user
is redirected to the seconds task with a redirect_to and a GET request.
The user completes the second task and submits a POST request.
The controller action for the second task completes the second task,
detects that the first task is pending and wants to complete the first
task.
The first request parameters are stored and a redirect_to with these
parameters would solve my problem. However a redirect_to results in a
GET request, and a POST request is required since it is destructive.
Can you suggest a way to solve this? Feel free to redirect me to proper
documentation.
documentation.
I can’t follow your way of thinking, but working in a restful manner
should destroy records using the DELETE verb (whether it uses a GET
or a POST to emulate that is not your concern anymore).
On Wed, 2008-02-06 at 17:07 +0100, Peter De Berdt wrote:
I can’t follow your way of thinking, but working in a restful manner
should destroy records using the DELETE verb (whether it uses a GET or
a POST to emulate that is not your concern anymore).
By ‘destructive’ I mean ‘will change the database’, not necessarily
delete.
Basically, I wish to process the original request, regardless of request
method (GET/POST/DELETE/PUT).
I now perform the redirect_to for a post request by returning a page
containing only a form with the action URL and parameters from the
original request:
Visible effect is a white page before the final result page is
displayed.
I am a bit uncomfortable by involving the /user/browser in this way, but
I am not able to find a better solution. I would rather only process
the original request on the server, but I need it to be a POST request.
Any suggestions are greatly appreciated.
Uwe
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.