0

我有以下一段 ruby​​ 代码:

authenticate_this(request.env["SOME_ID"])

我想知道的是如何在 HTTP GET 请求中放置这个“SOME_ID”。据我了解,这些rails请求参数是预设的?如果是这样,“SOME_ID”是什么?

谢谢

4

1 回答 1

0

Rails request parameters are available in the params hash. Put this next line in your ERB

= debug params

This line will tell you all about the params hash. Key values include

params[:id]
params[:object_id] # In a route like users/1/listings/1, this would be params[:user_id]
params[:form_contents] # the contents of a form are available in params
于 2013-04-07T15:03:40.540 回答