I'm new to rails and I can't figure out what's wrong with the syntax - it seems to be getting through the first block (for price) and is giving me an error once I hit 'score' => etc...
<% dataset = { %>
<% 'price' => [@wines.each do |wine| %>
<% wine.price_750 %>,
<% end].to_vector(:scale),%>
<% 'score' => [@wines.each do |wine| %>
<% if current_user.wine_ratings.scoped_by_wine_id(wine.id).exists? %>
<% current_user.wine_ratings.find_by_wine_id(wine.id).rating_value %>,
<% else %>
<% wine.rating %>,
<% end%>
<% end].to_vector(:scale)%>
<% }.to_dataset %>
here's the error message:
index.html.erb:13: syntax error, unexpected ';', expecting tASSOC ');'score' => [@wines.each do |wine|
index.html.erb:13: syntax error, unexpected tASSOC, expecting keyword_end ');'score' => [@wines.each do |wine|
index.html.erb:20: syntax error, unexpected '}', expecting keyword_end }.to_dataset
Anyone know what I'm doing wrong?