jquery - Rails Javascript haml variable creation -


i have code pasted below creation of variables in javascript rails + javascript variables

:javascript $( ".form-control" ).each(function( index ) {   var mix = $( ).attr("id").split("_"); var e_array = mix.shift(); var e_name = mix.join("_");  var error = "#{@account.errors[:" + e_name +"]}";  //var error = error[":" + ]; alert(error);    console.log( "#{@account.errors}"); }); 

why array return empty?

try "#{@account.errors['"+e_name+"']}";


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -