From: Dema Date: 2005-09-05T00:16:26+09:00 Subject: Re: params v.s. @params in rails? Not really. In this particular case, params is simply an accessor method to the @params instance variable, not a local variable. So, in practice, they�re equivalent. The recommendation for using the params method, instead of accessing the @params instance variable directly, is that it�s more uniform to use the accessor method, since you can also do that from the view. David A. Black wrote: > Hi -- > > On Sun, 4 Sep 2005, Barry wrote: > > > Both work in my controller class, so I am wondering what's the > > difference and when should each one be used? > > To the extent that this is a Rails question, you might want to ask it > in a Rails forum (mailing list or IRC channel). > > Meanwhile, the non-Rails-specific answer is that the bareword "params" > is a local variable, while "@params" is an instance variable. Local > variables are mainly a kind of "scratchpad" or temporary holding area > for data in the current local scope. Instance variables are unique > per object, rather than per scope, and give your objects a way to > maintain state across different methods and local scopes. > > > David > > -- > David A. Black > dblack@wobblini.net