# Params\[\] vs @params\[\]

**URL:** <https://www.ruby-forum.com/t/params-vs-params/93364>\
**Category:** Rails\
**Created:** [March 31, 2006, 6:10pm UTC](https://www.ruby-forum.com/t/params-vs-params/93364 "2006-03-31T18:10:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [March 31, 2006, 6:10pm UTC](https://www.ruby-forum.com/t/params-vs-params/93364/1 "2006-03-31T18:10:18Z")

</div>

Is there a difference in the way that params[] and @params[] are  
handled?

Is the ‘handling’ done by Ruby or Rails?

A pointer to the relevant documentation would be sincerely appreciated.  
Or just an answer would be ok too 😉

Thanks,  
Bill

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [March 31, 2006, 6:56pm UTC](https://www.ruby-forum.com/t/params-vs-params/93364/2 "2006-03-31T18:56:19Z")

</div>

params[] is preferred now because ‘params’ is a method call and  
‘@params’ is an instance variable. I had this question myself and  
when AWDR had both styles, I asked a Rails core team member when I  
saw him.

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid  
+1 513-295-4739

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [March 31, 2006, 7:23pm UTC](https://www.ruby-forum.com/t/params-vs-params/93364/3 "2006-03-31T19:23:55Z")

</div>

Thanks, Rob. The ‘preferred’ part still throws me since it’s apparently  
still true that ‘@params[]’ and ‘params[]’ will both work to access the  
params hash. Yes?

Also, when you say ‘params’ is a method call… I would have thought  
that it could also be a local variable whose interpretation at runtime  
would be context sensitive. No?

Confusing ;-(

Thanks again,  
Bill  
----- Original Message -----  
From: Rob B.  
To: removed\_email\_address@domain.invalid  
Sent: 2006-03-31 10:53 AM  
Subject: Re: [Rails] params[] vs @params[]

params[] is preferred now because ‘params’ is a method call and  
‘@params’ is an instance variable. I had this question myself and when  
AWDR had both styles, I asked a Rails core team member when I saw him.

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid  
+1 513-295-4739

On Mar 31, 2006, at 10:51 AM, Bill W. wrote:

```
Is there a difference in the way that params[] and @params[] are 

```

handled?

```
Is the 'handling' done by Ruby or Rails?

A pointer to the relevant documentation would be sincerely 

```

appreciated. Or just an answer would be ok too 😉

```
Thanks,
Bill
_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails

```

* * *

* * *

Rails mailing list  
removed\_email\_address@domain.invalid  
[http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [March 31, 2006, 7:36pm UTC](https://www.ruby-forum.com/t/params-vs-params/93364/4 "2006-03-31T19:36:06Z")

</div>

On 3/31/06, Bill W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks, Rob. The ‘preferred’ part still throws me since it’s apparently  
> still true that ‘@params[]’ and ‘params[]’ will both work to access the  
> params hash. Yes?

Think “deprecated.” Using @params will work, but it’s not the  
idiomatic way of doing it.

– James
