The question you contacted had a second answer related to a blog post that came later, which is now dead ... but I found it on archive.org! The message also contains the text with the code needed in the initializer so that you can name your files ending in js.coffee_hamland process them.
In the interest of preventing future dead links, the code is given here in essence, but I did not write it and did not check if it still works:
module Coffee
module Rails
class HamlTemplateHandler
def self.haml_handler
@@haml_handler ||= ActionView::Template.registered_template_handler(:haml)
end
def self.call(template)
compiled_source = haml_handler.call(template)
"CoffeeScript.compile(begin;#{compiled_source};end)"
end
end
end
end
ActiveSupport.on_load(:action_view) do
ActionView::Template.register_template_handler :coffee_haml, Coffee::Rails::HamlTemplateHandler
end
, haml , , - coffeescript, :
if xyz == 1
do_this y
do_that x
:plain:
:plain
if xyz == 1
do_this y
do_that x