I have a problem with the datetime_select helper. In my view i use these both statements: <%= datetime_select :absent :last_date %> <%= date_select :absent :last_date %> in my db last_date is declared as type ''datetime'' The date_select helper works fine, but the datetime_select helper generates a private method ''hour'' called for #<Date: 49.......> message in date_helper.rb :150 in ''select_hour'' Thanks for help -- 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 -~----------~----~----~----~------~----~------~--~---
Otmar Tschendel wrote:> I have a problem with the datetime_select helper. > In my view i use these both statements: > > <%= datetime_select :absent :last_date %> > <%= date_select :absent :last_date %> > > in my db last_date is declared as type ''datetime'' > > The date_select helper works fine, but the datetime_select helper > generates a > > private method ''hour'' called for #<Date: 49.......> message > > in date_helper.rb :150 in ''select_hour'' > > Thanks for helpWhat are you unhappy about; why can''t you use the version that works? What are you trying to do? Stephan -- 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 -~----------~----~----~----~------~----~------~--~---
Stephan Wehner wrote:> Otmar Tschendel wrote: >> I have a problem with the datetime_select helper. >> In my view i use these both statements: >> >> <%= datetime_select :absent :last_date %> >> <%= date_select :absent :last_date %> >> >> in my db last_date is declared as type ''datetime'' >> >> The date_select helper works fine, but the datetime_select helper >> generates a >> >> private method ''hour'' called for #<Date: 49.......> message >> >> in date_helper.rb :150 in ''select_hour'' >> >> Thanks for help > > > What are you unhappy about; why can''t you use the version that works? > What are you trying to do? > > StephanThe date_select only shows the date. The datetime_select normaly gives you date and time - and thats what i need. I tested both, because both use the same parameter - so i think there is a error in rails. -- 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 -~----------~----~----~----~------~----~------~--~---
Otmar Tschendel wrote:> The date_select only shows the date. The datetime_select normaly gives > you date and time - and thats what i need. I tested both, because both > use the same parameter - so i think there is a error in rails.You mean you think that datetime_select doesn''t do what it was designed to do? Why does the error message say <#Date.. if you say the column is datetime ? What do you get when you execute, in "script/console", ModelName.columns.find { |a| a.name==''last_date'' } (I don''t know the model name in question here) Stephan -- 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 -~----------~----~----~----~------~----~------~--~---
Stephan Wehner wrote:> Otmar Tschendel wrote: > >> The date_select only shows the date. The datetime_select normaly gives >> you date and time - and thats what i need. I tested both, because both >> use the same parameter - so i think there is a error in rails. > > You mean you think that datetime_select doesn''t do what it was designed > to do? > > Why does the error message say <#Date.. if you say the column is > datetime ? > > What do you get when you execute, in "script/console", > > ModelName.columns.find { |a| a.name==''last_date'' } > > (I don''t know the model name in question here) > > StephanMany thanks for your direction. It was not rails, it was was my fault. I used the wrong column in my db. Otmar -- 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 -~----------~----~----~----~------~----~------~--~---