I'm trying to create an array of values within an input field. However, the values need to have quotes and I'm having a hard time with quotes canceling each other out.
Here is my code:
<input type="text" data-provide="typeahead"
data-source='[<% @results.each do |result| %>"<%= result['name'] %>",<% end %>]'>
My issue is that I have either two sets of "
or '
. When I try something like result[name]
without the quotes I get the error: undefined local variable or method `name'.
Updated as I need data-source to have the ''s and data inside to have the ""s
How can I get around this?