move this code to controller and use [map](http://www.ruby-doc.org/core-1.9.3/Array.html#method-i-map)