Integrated d3 onClick with ajax requests to Rails.