Hi am new at Grails i have implemented a delete action that deleted messages in an inbox,, but now i want to change the flash message to display \"2 Messages deleted\" not
You could do this:
def device = MessagingDevice.findByPhoneNumber(params.phoneNumber)
// invoke deleteFromDevice on domain object, which returns number of objects deleted
def count = messageInstance.deleteFromDevice(device)
if (count) {
flash.message = message(code: 'default.deleted.message', args: [message(code: 'message.deleted.label', default: '{0} Messages deleted'), count])
redirect(action: "phone", params:[phoneNumber:params.phoneNumber])
}
and in your messages.properties
message.deleted.label={0} deleted