Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
jQueryを使用してDateTimeを実行するためのフォームビルダーフィールドがあります。私がやりたいのは、ヘルパーがcontent_forを介してコンテンツを<head>にプッシュできるようにすることです。何か案は?
ありがとう、ステファン
@template インスタンス変数で任意のヘルパー メソッドを呼び出すことができます。現在のテンプレート コンテキストを保持します。
class MyBuilder < ActionView::Helpers::FormBuilder def this_method_appends_content_for(content) @template.content_for(:head, content) end end