エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
What does 'yield resource' in the Devise controllers do?
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
What does 'yield resource' in the Devise controllers do?
I was looking through the Devise code and noticed that most of the controllers yield the resource... I was looking through the Devise code and noticed that most of the controllers yield the resource being created. class Devise::RegistrationsController < DeviseController # ... def create build_resource(sign_up_params) resource.save yield resource if block_given? # ... This must be some sort of extendability feature but I don't really get how you would pass a block to to the controller action? Note