Rails 3 でオリジナルのJuggernaut ( Juggernaut 2@template
ではない) を使用しています。この他の投稿によると@template
、Rails 3 のコントローラーでは提供されていません。
Rails 3でスムーズに実行できるように、次のコードを修正するにはどうすればよいですか? (元のスクリプトへのリンクは次のとおりです。 を探してくださいrender_with_juggernaut
。)
if @template.respond_to?(:_evaluate_assigns_and_ivars, true)
@template.send(:_evaluate_assigns_and_ivars)
else
@template.send(:evaluate_assigns)
end
generator = ActionView::Helpers::PrototypeHelper::JavaScriptGenerator.new(@template, &block)
render_for_juggernaut(generator.to_s, options.is_a?(Hash) ? options[:juggernaut] : nil)
私は2つのことのうちの1つができると考えています:
- @template をどうにかして手に入れる
- JavaScriptGenerator を使用せずに JS のスニペットを生成する (@template が必要)
これらまたは他の方法のいずれかを行う方法について何か提案はありますか?
ありがとう!