documentcloud/jammit — Issue #216: String interpolation not working
Author: rottmanj
Created: 2012-01-08 09:59:32+00:00
State: open

For some odd reason, string interpolation is not working from with in my js files.

I have the following bit of javascript. What should happen is that the string #{validate_username_broker_userdesk_accounts_path} should be calculated and the string replaced. How ever this is not working.

$("#user_username").focusout(function(){
username =
$.ajax({
type: 'POST',
url: "#{validate_username_broker_userdesk_accounts_path}",
data: { username : $('#user_username').val() },
success: function(data){
if(data.results)
{
$('#user_username').addClass( "ui-state-error" );
}else
{
$('#user_username').removeClass( "ui-state-error" );
}
},
dataType: 'json'
});
});