Moving dojo edit code to controller