Michael B. wrote:
You guys are very right, and this is more for just-so-you-know than
actuall use in a production environment, but you could use it if your
hash doesnt have a lot of keys. How many of you have had a hash with a
key of to_a?
It’s not only to_a, to_s: Hash objects have a lot of methods, for
example:
clear, collect, default, display, entries, index, shift, select,
store, size, sort, type, update, values
Even Object method names make good form parameter names, such as
inspect, send, id, freeze, extend, display, method, type
For some application these names would be convenient to use in this
other way.
Alternatively, you could do something else, which I’ll
have up in a few.
Sounds good! In the mean time, I’m thinking double-underscores might do
the trick as in param__user__id for params[:user][:id] (3 characters
shorter).
Stephan