0

I want to check the form data received from the form in ruby on rails controller.

I tried this but nothing is shown:

@user.to_yaml

where @user is the form name(<%=form_for @user )

Sachin Prasad
  • 5,365
  • 12
  • 54
  • 101

3 Answers3

2

the data sent by a form is stored in the params hash (see this question for more information).

also, in development, just put a raise in your controller action to show an error page with all request parameters displayed.

Community
  • 1
  • 1
m_x
  • 12,357
  • 7
  • 46
  • 60
2

The above answer is correct. but will like to change something

all the details are stored in params only

and it will be better to show those in flash by doing flash.notice = params

as it will not effect the working of app

Aayush Khandelwal
  • 1,071
  • 7
  • 11
1

Why don't you check out the server log on the console or use the debugger gem that would keep track of the params and the files along which the request moves along...

Aditya Kapoor
  • 1,542
  • 10
  • 13