Merge ajax affect method in controller.