Skip to content

Commit f172824

Browse files
committed
[docs] Add note about params hash
Newbies tends to misunderstand params hash is a plain old Hash. So I added a note that params hash is ActionController::Parameters.
1 parent 8f386d7 commit f172824

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

guides/source/action_controller_overview.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ class ClientsController < ApplicationController
110110
end
111111
```
112112

113+
NOTE: The `params` hash is not a plain old Ruby Hash; instead, it is an [`ActionController::Parameters`][] object. While it behaves like Hash, it does not inherit from Hash.
114+
113115
[`params`]: https://api.rubyonrails.org/classes/ActionController/StrongParameters.html#method-i-params
116+
[`ActionController::Parameters`]: https://api.rubyonrails.org/classes/ActionController/Parameters.html
114117

115118
### Hash and Array Parameters
116119

0 commit comments

Comments
 (0)