Is it possible to grab a post variable in a action, output it to the screen, and then halt execution?
in asp.net I would do:
Response.Write (Request.Form["blah"]);
Response.End();
Is it possible to grab a post variable in a action, output it to the screen, and then halt execution?
in asp.net I would do:
Response.Write (Request.Form["blah"]);
Response.End();
If you are trying to send it back to the browser (output to screen?) to debug, you can drop this line in your action. The "return" will prevent a double render error. But this will not halt execution of after_filter if you have one.
render :text=> params[:blah] and return
In addition to suggestions already mentioned, you can raise exceptions:
raise params[:blah]
raise params.inspect
raise params.to_yaml
# ...and so on
In this case, you can even just do raise
without specifying anything. Rails will by default print out all params
as part of its exception message screen.