{"action":"closed","issue":{"url":"https://api.github.com/repos/ga-dc/project3/issues/62","labels_url":"https://api.github.com/repos/ga-dc/project3/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/ga-dc/project3/issues/62/comments","events_url":"https://api.github.com/repos/ga-dc/project3/issues/62/events","html_url":"https://github.com/ga-dc/project3/issues/62","id":121116721,"number":62,"title":"loop filtered by text being passed in ","user":{"login":"ScreenName4eva","id":13292920,"avatar_url":"https://avatars.githubusercontent.com/u/13292920?v=3","gravatar_id":"","url":"https://api.github.com/users/ScreenName4eva","html_url":"https://github.com/ScreenName4eva","followers_url":"https://api.github.com/users/ScreenName4eva/followers","following_url":"https://api.github.com/users/ScreenName4eva/following{/other_user}","gists_url":"https://api.github.com/users/ScreenName4eva/gists{/gist_id}","starred_url":"https://api.github.com/users/ScreenName4eva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScreenName4eva/subscriptions","organizations_url":"https://api.github.com/users/ScreenName4eva/orgs","repos_url":"https://api.github.com/users/ScreenName4eva/repos","events_url":"https://api.github.com/users/ScreenName4eva/events{/privacy}","received_events_url":"https://api.github.com/users/ScreenName4eva/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-08T22:41:05Z","updated_at":"2015-12-09T15:43:48Z","closed_at":"2015-12-09T15:43:48Z","body":"i'm trying to create a loop in my view file that can filter on the station colors that we have in our seed file.  and then when i click on the station color in the html the stations associated with that color will show.  I'm not sure not sure how to pull in only the station metroLines and pass the color as a string into it\r\n\r\n```js\r\nStationView.prototype = {\r\n  render: function(){\r\n    var self = this;\r\n    var station = self.station\r\n    var metro = self.metroLine\r\n    // self.$el.html(self.stationName());\r\n\r\n    $('#blueline').on('click',function(){\r\n      if (station.metroLine = \"Blue\" ){\r\n            self.$el.html(self.metroLoop());\r\n\r\n      }  else {console.log(\"no blue\")}\r\n\r\n\r\n\r\n      // console.log(\"clicked\")\r\n    });\r\n  },\r\n\r\n    stationName: function(){\r\n      var station = this.station\r\n      var metro = station.metroLine\r\n      var html = $(\"<div class='stationdiv'>\");\r\n      html.append(\"<h3><a>\" + station.name + \"</a></h3>\");\r\n      return(html);\r\n    },\r\n\r\n    metroLoop: function(color){\r\n      var station = this.station\r\n      var html = $(\"<div class='stationdiv'>\");\r\n      var stationList = []\r\n      for(var i = 0; i < station.length; i++){\r\n        if (station.metroLine[i] = \"Blue\"){\r\n           html.append (\"<h3><a>\" + station.name + \"</a></h3>\")\r\n        }\r\n\r\n        // html.append (\"<h3><a>\" + stationList + \"</a></h3>\");\r\n      }\r\n    }\r\n\r\n}//end of stationview\r\n```"}}