How to make if loop in grails?
- by user3569696
I'm beginner in Grails, please help. I have this in my gsp
<div class="right66">
<g:select class="time_pick" name="pick_day" placeholder="" from="${['Dani', 'Sati', 'Minute']}" valueMessagePrefix="book.category"/>
</div>
In translation: Dani=Days, Sati= Hours, Minute= Minutes. I need to save data in minutes but User have privilege to choose will his input be in minutes, days or hours. So i have to do if loop. I now how if loop works but i don't know how to wite it in grails. I was thinking something like this:
n=1
if(params.type=Dani){
n= 3600
}else if(params.type=Sati) {
n=60
}
def minute=params.minute*n
but how to call that choosen input "Dani"? I can't write Params.type=Dani. Does if loop go in controller in my case?