dnagir / ruby-haml-js

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

ExecJS::ProgramError: ReferenceError: Can't find variable: console #2

Closed Draiken closed 12 years ago

Draiken commented 12 years ago

Here is the template

%h1 Errors

%ul#errors
  - errors.each do |error|
    %li= error

When I open the file with this template, call render on it, this error is raised.

dnagir commented 12 years ago

You are using Ruby in JavaScript HAML. Please use the syntax as described at https://github.com/creationix/haml-js

Here is how you need to write it:

%h1 Errors

%ul#errors
  :each error in errors
    %li= error
Draiken commented 12 years ago

Thank you!

dnagir commented 12 years ago

You are welcome.