def index
tag_array=[]
courses = current_user.studio.courses
courses.each do |a|
tag_array << a.age_tag.id
tag_array << a.level.id
tag_array << a.category.id
end
@tags=current_user.studio.tags
tags.each do |d|
e=tag_array.where(:id => d).count
d.store("count",e);
end
end
I'm looking for a way in rails to count the number of times the key/value pair of :id => d shows up in an array, then append it to a value in an each statement. Rails keeps throwing errors saying that .where and .store are not valid functions.