When I add my rails code into my jquery I have this problem:
Uncaught SyntaxError: Unexpected token <
Here my controller:
class WelcomeController < ApplicationController
def index
@a = "12345"
end
end
My index.js
jQuery(function($) {
$(document).ready(function($) {
var a = <%= @a %>
var url = "http://www.google.com"
console.log(a)
});
});
I don't know how to fix that, please help me!