Im trying to generate html using rails select_tag and save it into a variable to be dynamically used. For some reason, below is causes this error:
Uncaught syntax error: Unexpected token ILLEGAL
Below is the problem code:
function addItemRowHTML(offsetidentifiervalue)
{
$node = ' \
<%= select_tag "currency",
options_for_select(Country.all.each_with_index.map {
|country, index|
[country["currency_code"],
country["currency_code"]]},
@invoice["data"]["currency"] ),
:style => "width:120px"
%> \
';
}
text_field_tag works though
$node =' <%= text_field_tag("amount", "10") %> ';
so how would i handle select_tag ? thanks