# application_helper.rb
def do_some_stuff
...
end
# my_model.rb
def my_model_method
# I want to call the method "do_some_stuff" here, how exactly?
end
분명히 do_some_stuff
을 호출 할 수 없습니다. 모델에이 메서드가 없다는 것을 알려주기 때문에 분명합니다.내 모델에서 ApplicationHelper 내부의 메서드를 어떻게 호출합니까?
y 그렇게 할 필요가 있습니까? –
아니요, 할 수 없습니다. 모델에 메서드를 작성하고 개체에 호출하십시오. –