ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Rolling with Ruby on Rails
Subject:   Problems with date
Date:   2006-04-14 19:14:36
From:   Arican
I wrote the edit.rhtml for updating the records but when I try to update a date I go into trouble. The date is seperated into 3 parts in the original code and every part is given with an #i like recipe[date(1i)],recipe[date(2i)]
1 for day 2for month and 3 for year. I tried to write my edit.rhtml which shows the existing data and then the user can update it but when I write same way as the input it gives an error except when I write <option value="<%=@recipe.date%>" selected="selected"><%=@recipe.date%></option> which put the original date in the first box. My question is how to seperate the existing date into these 3 parts and give them as selected text.
Thank you