A
A
Anton Misyagin2018-09-28 23:16:12
Ruby on Rails
Anton Misyagin, 2018-09-28 23:16:12

How to write coffeescript inside html.haml/html.erb?

I can do this:
app/views/some_controller/some_action.html.haml

%h1 Заголовок
javascript:
     alert("Это js #{@some_var}");

And I want, but I can't:
app/views/some_controller/some_action.html.haml
%h1 Заголовок
coffescript:
     alert "Это кофе #{@some_var}"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
N. Bekseitov, 2018-09-30
@sunnmas

Isn't there a colon in front of haml(:coffeescript)?
https://berislavbabic.com/rails-no-nos-using-inlin...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question