create method for print relate in controller class