From b33d081c28bb4c808fef732ead36e8f97de080e6 Mon Sep 17 00:00:00 2001 From: did Date: Sat, 28 Jan 2012 01:05:26 -0800 Subject: [PATCH] use the view_context method to reach helper methods from a controller --- lib/locomotive/liquid/tags/inline_editor.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/locomotive/liquid/tags/inline_editor.rb b/lib/locomotive/liquid/tags/inline_editor.rb index 77f345e1..7b9a87f2 100644 --- a/lib/locomotive/liquid/tags/inline_editor.rb +++ b/lib/locomotive/liquid/tags/inline_editor.rb @@ -6,14 +6,15 @@ module Liquid def render(context) if context.registers[:current_locomotive_account] && context.registers[:inline_editor] + controller = context.registers[:controller] + plugins = 'common/format,common/table,common/list,common/link,common/highlighteditables,common/block,common/undo,common/contenthandler,common/paste,common/commands,common/abbr,common/horizontalruler' %{ - #{ActionController::Base.helpers.stylesheet_link_tag 'aloha/css/aloha.css'} - #{ActionController::Base.helpers.javascript_include_tag 'locomotive/aloha', :'data-aloha-plugins' => plugins} - + #{controller.view_context.stylesheet_link_tag 'aloha/css/aloha.css'} + #{controller.view_context.javascript_include_tag 'locomotive/aloha', :'data-aloha-plugins' => plugins}