Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はレールの初心者です。これら2つの違いを知りたいです:
params["user_id"]
と
params[:user_id]
最初の呼び出しではstringを[]メソッドに渡し、2 回目の呼び出しではsymbolを渡します。paramsインスタンスを返すためHashWithIndifferentAccess、返されるオブジェクトに違いはありません。
[]
params
HashWithIndifferentAccess
HashWithIndifferentAccessクラスの詳細については、こちらをご覧ください。