separated the javascript from the html and used json and jbuilder to remove the embedded ruby. freaky shit happened, had to add method: :get in the map link for the map page to work, it links to the right url but for some reason javascript doesnt get the information and render it on the page without adding this. something to do with the post id being undefined from the homepage and no page refresh that comes with the get request...