私の見解では、このコードをいくつかのjavascript変数に使用しています。私はそれをより効率的にすることができる任意のアイデア?不安定なコードが表示される
<% @sources.each_with_index do |source, index| %>
(<%= index %>, 1, <%= Entry.includes(:main_entries).where("classification_id =? and category_id =? and source_id =?", 1, 1, source.id).count %>)
(<%= index %>, 2, <%= Entry.includes(:main_entries).where("classification_id =? and category_id =? and source_id =?", 1, 2, source.id).count %>)
<% end %>