0

I am new to Ruby on Rails. I am not getting the clear idea of what is params in Rails. Can anyone please explain?. Thanks in advance.

Gomathi
  • 23
  • 9
  • Possible duplicate of [Rails params explained?](https://stackoverflow.com/questions/6885990/rails-params-explained) – Anurag Aryan Jan 08 '18 at 20:32

1 Answers1

2

Params in Ruby on Rails is a hash. It is the collection of data received by the application during a particular HTTP request. The data may be obtained from different sources such as links, form submissions, and redirects.

You can access it like this.

params[:user]

It's value will be something like this.

{ "name" => "Michael", "phone" => "350526", "address" => { "postcode" => "4600", "city" => "Kathmandu" } }

Here below are some of the links on this subject. Hope these will be helpful for you to better understand it.

https://gorails.com/episodes/the-params-hash

http://guides.rubyonrails.org/action_controller_overview.html

http://api.rubyonrails.org/classes/ActionController/Parameters.html

Nabin Paudyal
  • 1,591
  • 8
  • 14