简体   繁体   中英

Finding form fields in a Rails POST request

I'm using a plain old HTML form to send a post request to a rails app. Inside the app I would like to grab some of the input fields. I'm having trouble finding them inside the request.

Trying this:

logger.debug "Request Headers #{request.headers.inspect}"

Spits out a massive amount of data but I cannot find my form fields in there. Does anyone know where I can find them?

You can grab the request parameters submitted using:

logger.debug params.inspect

That will show all the form data submitted.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM