Mike Manfrin
Mike Manfrin

Reputation: 2762

Came across a 'params.store' line -- is there any difference/benefit over params[:key]

Coworker came across a line of code that referenced params.store 'keyname', value, which appears to do the same thing as params[:keyname] = value.

Neither of us have seen the first syntax. Is there any difference with how this is evaluated? Google is unhelpfully not honoring my searches using "params.store" (returning bolded results referencing params[:store]), so I haven't been able to find anything on using :store over the hash syntax.

Upvotes: 0

Views: 30

Answers (1)

ethyl.bradtke
ethyl.bradtke

Reputation: 199

The store equal to []=. Just check description of these methods and source code here.

UPDATE: Here is place is Ruby sources which show that the store equal to []=.

Upvotes: 2

Related Questions