strong_parameters ã®ã½ã¼ã¹èªãã§ãã Hash#slice ã使ããã¦ãããã¨ã«æ°ã¥ãã¦ããããããããªã¡ã½ãããã£ãã£ãï¼ãã¨ãªã調ã¹ã¦ã¿ã¾ãããã©ããã Rails(ActiveSupport) 㧠hash ãæ¡å¼µãã¦ããããã§ãã
å¼æ°ã® key ã ããå«ã hash ãè¿ãã¾ããç ´å£ç㪠Hash#slice! ãããã¾ãã
hash = {a: 'hoge', b: 'fuga', c: 'foo'}
hash.slice(:b, :c) #=> {:b=>"fuga", :c=>"foo"}
Rails 2.1 ãã使ããããã«ãªã£ã¦ãããããã§ããå ¨ç¶ç¥ããªãã£ãâ¦ã
Rails-2.1ããHash#sliceã使ããããã«ãªã£ãæ¨¡æ§ - Hello, world! - s21g