エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
記事へのコメント3件
- 注目コメント
- 新着コメント
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Using "try" with a hash to check existence of a key
Using “try” with a hash to check existence of a key The try method is awesome. Check the document... Using “try” with a hash to check existence of a key The try method is awesome. Check the documentation. It is usually used to call a method on an object if it exists, or return nil if it doesn’t. But sometimes, it is not used with hashes, but this also works perfectly: params[:search] ? params[:search][:name] : nil # Can also be written as... params[:search].try(:[],:name)





2012/04/11 リンク