# Params 101

**URL:** <https://www.ruby-forum.com/t/params-101/71275>\
**Category:** Rails\
**Created:** [October 6, 2006, 4:43pm UTC](https://www.ruby-forum.com/t/params-101/71275 "2006-10-06T16:43:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [October 6, 2006, 4:43pm UTC](https://www.ruby-forum.com/t/params-101/71275/1 "2006-10-06T16:43:18Z")

</div>

This is incredibly basic, but…

I have a form that has fields defined for password and  
password\_confirmation. it is passing in the following data

Parameters: {“commit”=\>“Change Password”,  
“admin”=\>{“password\_confirmation”=\>“beagle”, “password”=\>“beagle”},  
“id”=\>“3”

I thought that processing the form data was a simple matter of  
referencing params[:password] - but that is a nil value. It appears to  
me that the password post data is within a hash within the hash. The  
data is there, but the reference form is unclear.

What is the correct reference to the post data? e.g. how do I reference  
the :password field?

Please forgive the very basic question.  
—Michael

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [October 6, 2006, 4:56pm UTC](https://www.ruby-forum.com/t/params-101/71275/2 "2006-10-06T16:56:17Z")

</div>

well you can access that information from params[:admin][:password]

the admin hash is because you probably put in your form like this \<%  
= password\_field “admin”, “password” %\> or in a form\_for construct…

if you wanted to access just params[:password] you can do something  
like…

\<%= password\_field\_tag “password”, nil %\>

jason.

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [October 6, 2006, 5:00pm UTC](https://www.ruby-forum.com/t/params-101/71275/3 "2006-10-06T17:00:50Z")

</div>

jason cale wrote:

> well you can access that information from params[:admin][:password]
> 
> the admin hash is because you probably put in your form like this \<%  
> = password\_field “admin”, “password” %\> or in a form\_for construct…

Jason,

Thanks.

The params field is a tad more involved (in a very good way) than it  
appears on the surface. The data is there, but the referencing needs to  
be done in the right way.

I never cease to be amazed at the willingness of the people here to help  
people come up on rails. I do appreciate the help and promise to do my  
homework.

—Michael

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [October 6, 2006, 5:10pm UTC](https://www.ruby-forum.com/t/params-101/71275/4 "2006-10-06T17:10:21Z")

</div>

you’re very welcome 🙂
