How to use Jade/Haml with Rails 3.1 asset pipeline and backbone.js
Asked Answered
R

1

5

Currently I am using backbone-rails in my Rails app. I would like to know how to use client side Haml/Jade backbone.js with that gem and the rails asset pipline.

Reference answered 12/12, 2011 at 5:52 Comment(0)
C
11

I'm using haml_coffee_assets and it works perfectly !

Haml templates are compiled with the Rails assets, and then on the client side you "render" the templates.

test.hamlc:

%span
   = @title

on client side:

JST["test"]({title: "Yeah"})

=> <span>Yeah</span>

UPDATE My project has grown very big now (Feb 2012), and I confirm it's working really, really well !

Clapper answered 12/12, 2011 at 9:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.