I have this array of team names:
teams = ["Atlanta Hawks","Boston Celtics","Brooklyn Nets"]
I want to iterate over teams array, and insert each team into the css selector for 'title':
teams.each do |team_name|
basketball_team_links << basketball_teams.css("a[class='lnkBeatWriterLeague'][title=#{team_name}]").map { |link| link['href'] }
end
Obviously my approach is flawed, and I can't figure out how to read in the |team_name| variable.