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.
これbrandids=[1,2,3]は整数の配列です。
brandids=[1,2,3]
一度に 1 つの値を取得して、それを params のパラメーターとして 1 つずつ使用できるようにする方法。
配列の最初の要素を抽出する「シフト」メソッドを使用します。
> param = brandids.shift > param # => 1 > brandids # => [2, 3]
これはあなたの質問に当てはまりますか?