ed1t
ed1t

Reputation: 8699

how to concatenate javascript and rails 3

I have the following code in my application.erb.html $alertdiv.text("some message"); but I need to pass in message instead of hard coded message. I need to pass in the notice so I tried doing something like $alertdiv.text(<%= notice %>); but that didn't work

Upvotes: 0

Views: 165

Answers (1)

Dylan Markow
Dylan Markow

Reputation: 124419

You still need to wrap the <%= %> tags in quotation marks:

$alertdiv.text("<%= notice %>");

Upvotes: 1

Related Questions