Reputation: 43
Rails
Ajax
SLIM
I would like to use SLIM for my Rails views, but I can't figure out the syntax for using a Ruby variable inside an Ajax call.
If my view has an html.erb extension, I can put in it something like this:
<script>
$('#MyDivId').replaceWith({
ajax: '/users_activities?email=<%= @user.email%>'
});
</script>
But, if this was a .html.slim view, if I do:
javascript:
$('#MyDivId').replaceWith({
ajax: '/users_activities?email=<%= @user.email%>'
});
I would get an error message. Any idea what the proper syntax is for doing this in SLIM?
Upvotes: 0
Views: 109