Basically I am using the code below for debugging. It renders null and I cannot figure out the reason. And by the way the else statement will always be executed at this point. At first I didnt have the save method but I then thought it might fix my issue. May is have to do with the scope of my domains? As of now I have them set to session scope: class Info { static scope = "session" String name String smokingStatus String[] symptom static constraints = { } }
else{//query did not find patient with that id
def patInfo = new Info()
patInfo.name = "Dennis"
patInfo.smokingStatus = "Former Smoker"
patInfo.symptom = ["Cough"]
patInfo.save()
redirect(action:"display", params: [patInfo:patInfo])
//redirect(action:"login")
//return to login action and
}
}
}
def display(){
render params.name
}
Thanks for any help its much appreciated.