Creating the method to trace route in controller