Rails: How do I print the request parameters?

后端 未结 8 1647
挽巷
挽巷 2020-12-13 06:11

I have a Rails 3 application and I want to print in the view the request parameters. How do I do it?

Edit:

The purpose is to see what is being sent in a Form

8条回答
  •  南笙
    南笙 (楼主)
    2020-12-13 06:20

    Learnt this from the Ruby Hero James Edward Gray II on this episode of Ruby Rogues podcast which I highly recommend. raise is a swiss army knife for inspecting anything in your Rails code which prints it nicely on your browser.

    raise params.inspect

提交回复
热议问题