communication with rails