Hi,
I am trying to use a rails helper in a haml filter, is it possible somehow?
Something like this maybe:
module Haml::Filters::Javascript
def render_with_options(text,options)
content_for(:javascript) {
text.rstrip.gsub("\n", "\n ")
}
end
end
Would love for some help, since right now it errors with
undefined method `content_for' for Haml::Filters::Javascript:Module
which is understandable ... do I need to include some kind of rails module or something?