dnagir / ruby-haml-js

HAML-JS Tile and Rails 3.1 Template
MIT License
86 stars 13 forks source link

How can I use this with img #6

Closed alexandru-calinoiu closed 12 years ago

alexandru-calinoiu commented 12 years ago

Hi,

I am trying to have something like:

%img{:src => cart_image_url}

I get an "Unexpected token >" error. Any ideas how I can achive this?

Thanks,

dnagir commented 12 years ago

The attribute syntax is a bit different from Ruby HAML. Please see the haml-js.

What you need to do is:

%img{src: cart_image_url}

Also keep in mind that you can't access any Ruby stuff there (including URL helpers) since it is a JavaScript runtime.

alexandru-calinoiu commented 12 years ago

Thanks,