hi all, i have used date_select in my rhtml... when i read the parameters in the controller, it returns as an arrry like xxx(1i)=>2007, xxx(2i)=>2, xxx(3i)=>7 i want to find out the day of that particular date if there any posibility to get that one.... if anyone knows guide me... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Madhankumar Nagaraj wrote:> hi all, > i have used date_select in my rhtml... > when i read the parameters in the controller, it returns as an arrry > like > xxx(1i)=>2007, xxx(2i)=>2, xxx(3i)=>7 > i want to find out the day of that particular date > if there any posibility to get that one.... > > if anyone knows guide me...Hi, AR will parse automatically your hash and create a Date object. So, if you date belongs to Person.created_on attribute for instance, you just need to do: person = Person.new(params[:person]) day_you_were_looking_for = person.created_on.day. Regards, Jean-Etienne http://www.woa.hu -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
dear sir, i am very happy to inform u that, i got the result what i expected.. just 1 month before only i started to learn ruby. thank u for ur kind help. ur Madhan Jean-Etienne Durand wrote:> Madhankumar Nagaraj wrote: >> hi all, >> i have used date_select in my rhtml... >> when i read the parameters in the controller, it returns as an arrry >> like >> xxx(1i)=>2007, xxx(2i)=>2, xxx(3i)=>7 >> i want to find out the day of that particular date >> if there any posibility to get that one.... >> >> if anyone knows guide me... > > Hi, > > AR will parse automatically your hash and create a Date object. So, if > you date belongs to Person.created_on attribute for instance, you just > need to do: > > person = Person.new(params[:person]) > day_you_were_looking_for = person.created_on.day. > > Regards, > Jean-Etienne > http://www.woa.hu-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---