2
내 Padrino 앱에서 알림 (플래시) 메시지를 생성하기 위해 맞춤 알림 도우미를 사용하고 싶습니다. 도우미 내부 내가 내장 된 대부가 도우미 (플래시 및 content_tag를 사용하려면 (맞춤 헬퍼 클래스에서 Padrino 헬퍼를 사용하는 방법
class NotificationHelper
def self.notify
unless flash.empty?
content_tag :div, class: 'notifications' do
flash.map do |key, msg|
headline = case key
when :success then 'Super!'
when :error then 'Oh. Das tut uns leid.'
end
content_tag :p, :class => "notification" do
content_tag(:span, headline, class: "headline #{key}") + msg
end
end.join("\n")
end
end
end
end
하지만 난 내 뷰에서 헬퍼를 사용하고 있다면, 다음과 같은 오류가 발생했습니다) 아래의 예를 참조하십시오. " NoMethodError - 정의되지 않은 메서드`content_tag 'NotificationHelper에 대한 : 클래스 : "
내가 잘못