以下のようなコードを書きましたが、hogeがundefined methodエラーになってしまって動きません。
どういう原因・対処が考えられるでしょうか。
Ruby
1#controllerのconcernsフォルダの中 2module ABC 3 extend ActiveSupport::Concern 4 #別のconcernに依存するのでinclude 5 include Common 6 7 def hoge 8 #何かの処理 9 end 10end
Ruby
1#あるコントローラー 2include Auth 3 4before_action{ |c| 5 if (hoge()) then 6 #コントローラ独特のbefore action 7 end 8}
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。