Finished implementation on Rails side