I've got controller on the back-end, and want to have variables inside (coffee)script which send with mockup to browser - but got undifined values. what I'm doing wrong? I could see values in mockup.
contoller:
def show
@article = Article.find(params[:id])
end
Script article.coffee.erb:
$ ->
$('#sendComment').click ->
id = "#{@article.id}"
console.log(id)
in mockup:
%p
%strong Title:
#id
= @article.id
%p
%strong Title:
= @article.title
#sendComment? Instead of mockup tell us where are you rendering that HAML?