Hello: I have a problem with dateHelper date_select. I think this is a bug. In a form, I''ve to list many objects of type "formacio" that a "persona" have. "formacio" object have an "id", two foreing key "centre_id" and "titulacio_id" and a "finalitza_on" date. The form have to be used to update attributes of all "formacions" of a "persona". In a form I have this code: <% @persona.formacions.each do |@formacio| %> <tr> <td> <%= select("formacio[]","titulacio_id", @titulacions ,{:include_blank => true }) %> </td> <td> <%= select("formacio[]","centre_id", @centres ,{:include_blank => true }) %> </td> <td> <%= date_select("formacio[]", "finalitza_on" ) %> <br> </td> <td> </td> <td> <%= link_to "Borrar",{ :action => "borrar_formacio", :id => @persona, :f_id => @formacio } %> </td> </tr> <% end %> Whell, the indexation with [] go pretty well with "titulacio_id" and "centre_id" but not with "finalitza_on". The params generated for two objects "formacio" with ids "25" and "26" are: Parameters: {"formacio"=>{ "finalitza_on(2i)"=>"3", "finalitza_on(3i)"=>"5", "25"=>{"centre_id"=>"", "titulacio_id"=>"2"}, "26"=>{"centre_id"=>"", "titulacio_id"=>"3"}, "finalitza_on(1i)"=>"1983"}, "commit"=>"Actualitza", "id"=>"9" } But what I need is: Parameters: {"formacio"=>{ , "25"=>{ "centre_id"=>"", "titulacio_id"=>"2", "finalitza_on(2i)"=>"3", "finalitza_on(3i)"=>"5", "finalitza_on(1i)"=>"1983" }, "26"=>{ "centre_id"=>"", "titulacio_id"=>"3" "finalitza_on(2i)"=>"6", "finalitza_on(3i)"=>"3", "finalitza_on(1i)"=>"1985" }, "commit"=>"Actualitza", "id"=>"9" } More information about my system: $ ruby -v ruby 1.8.4 (2005-10-29) [i486-linux] $ dpkg -l rails +++-===================-===================-===========================ii rails 0.14.3-1 MVC ruby based framework I''m using mysql on a Debian GNU/linux $ mysql -V mysql Ver 14.7 Distrib 4.1.15, for pc-linux-gnu (i486) using readline 5.0 What''s going wrong?
Hi, Have a look at this: http://dev.rubyonrails.org/ticket/847. Best regards, Tobie> Hello: > > I have a problem with dateHelper date_select. I think this is a bug. > > In a form, I''ve to list many objects of type "formacio" that a > "persona" > have. > > "formacio" object have an "id", two foreing key "centre_id" and > "titulacio_id" and a "finalitza_on" date. > > The form have to be used to update attributes of all "formacions" of a > "persona". > > In a form I have this code: > > <% @persona.formacions.each do |@formacio| %> > <tr> > <td> > <%= select("formacio[]","titulacio_id", @titulacions > ,{:include_blank => true }) %> > </td> > <td> > <%= select("formacio[]","centre_id", @centres ,{:include_blank => > true }) %> > </td> > <td> > <%= date_select("formacio[]", "finalitza_on" ) %> <br> > </td> > <td> > </td> > <td> > <%= link_to "Borrar",{ :action => "borrar_formacio", :id => > @persona, :f_id => @formacio } %> > </td> > </tr> > <% end %> > > > Whell, the indexation with [] go pretty well with "titulacio_id" and > "centre_id" but not with "finalitza_on". > > The params generated for two objects "formacio" with ids "25" and "26" > are: > > Parameters: {"formacio"=>{ > "finalitza_on(2i)"=>"3", > "finalitza_on(3i)"=>"5", > "25"=>{"centre_id"=>"", "titulacio_id"=>"2"}, > "26"=>{"centre_id"=>"", "titulacio_id"=>"3"}, > "finalitza_on(1i)"=>"1983"}, > "commit"=>"Actualitza", > "id"=>"9" > } > > But what I need is: > > Parameters: {"formacio"=>{ > , > "25"=>{ "centre_id"=>"", > "titulacio_id"=>"2", > "finalitza_on(2i)"=>"3", > "finalitza_on(3i)"=>"5", > "finalitza_on(1i)"=>"1983" > }, > "26"=>{ "centre_id"=>"", > "titulacio_id"=>"3" > "finalitza_on(2i)"=>"6", > "finalitza_on(3i)"=>"3", > "finalitza_on(1i)"=>"1985" > }, > "commit"=>"Actualitza", > "id"=>"9" > } > > More information about my system: > > $ ruby -v > ruby 1.8.4 (2005-10-29) [i486-linux] > > $ dpkg -l rails > +++-===================-===================- > ===========================> ii rails 0.14.3-1 MVC ruby based framework > > I''m using mysql on a Debian GNU/linux > > $ mysql -V > mysql Ver 14.7 Distrib 4.1.15, for pc-linux-gnu (i486) using readline > 5.0 > > > What''s going wrong? > > > ------------------------------
I too have this problem. My ruby and rails are the same version as lumen. Does anyone have a fix for this problem? -- 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 -~----------~----~----~----~------~----~------~--~---
abrahams-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jan-05 08:56 UTC
Re: bug in date_select
I don''t know who lumen is or what exactly your bug is, but I have experienced a bug with various actionview related items. Specifically value(object) calls in form_helper*.rb ActionView::TemplateError: wrong number of arguments (1 for 0) On line #32 of app/views/grants/_form.rhtml 29: <%= text_field ''grant'', ''ras_award_number'' %></p> 30: 31: <p><label for="grant_pi_id">Principle Investigator</label><br/> 32: <%= collection_select ''grant'', ''pi_id'', @pis, ''id'', ''name'' %></p> 33: 34: <p><label for="grant_project_title">Project Title</label><br/> 35: <%= text_field ''grant'', ''project_title'' %></p> #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb:308:in `value'' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb:308:in `to_collection_select_tag'' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb:71:in `collection_select'' #{RAILS_ROOT}/app/views/grants/_form.rhtml:32:in `_run_rhtml_47app47views47grants47_form46rhtml'' It does the same thing on datetime_select and other actionview calls. In the example above, the problem is in line 308 of forms_options_helper.rb. If you comment out that line it works. My rails foo isn''t good enough to patch it right now and I don''t have the energy to debug what value(object), but I suspect this will be caught swiftly and resolved. Although, I don''t know how it got into the release to be honest. I would have thought someone''s unittests would have caught it. I''m running frozen rails 1.2RC2. Ringo wrote:> I too have this problem. My ruby and rails are the same version as > lumen. > > Does anyone have a fix for this problem? > > -- > 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 -~----------~----~----~----~------~----~------~--~---
abrahams-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jan-05 09:01 UTC
Re: bug in date_select
I don''t know who lumen is or what exactly your bug is, but I have experienced a bug with various actionview related items. Specifically value(object) calls in form_helper*.rb ActionView::TemplateError: wrong number of arguments (1 for 0) On line #32 of app/views/grants/_form.rhtml 29: <%= text_field ''grant'', ''ras_award_number'' %></p> 30: 31: <p><label for="grant_pi_id">Principle Investigator</label><br/> 32: <%= collection_select ''grant'', ''pi_id'', @pis, ''id'', ''name'' %></p> 33: 34: <p><label for="grant_project_title">Project Title</label><br/> 35: <%= text_field ''grant'', ''project_title'' %></p> #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb:308:in `value'' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb:308:in `to_collection_select_tag'' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb:71:in `collection_select'' #{RAILS_ROOT}/app/views/grants/_form.rhtml:32:in `_run_rhtml_47app47views47grants47_form46rhtml'' It does the same thing on datetime_select and other actionview calls. In the example above, the problem is in line 308 of forms_options_helper.rb. If you comment out that line it works. My rails foo isn''t good enough to patch it right now and I don''t have the energy to debug value(object), but I suspect this will be caught swiftly and resolved. Although, I don''t know how it got into the release to be honest. I would have thought someone''s tests would have caught it. I''m running frozen rails 1.2RC2. Ringo wrote:> I too have this problem. My ruby and rails are the same version as > lumen. > > Does anyone have a fix for this problem? > > -- > 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 -~----------~----~----~----~------~----~------~--~---
I can''t help you with your problem, but you may want to look at DateBocks which provides a much nicer way of entering dates, including a pop-up calendar: http://www.oreillynet.com/ruby/blog/2006/09/datebocks_the_new_intuitive_da.html -- 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 -~----------~----~----~----~------~----~------~--~---
abrahams-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jan-05 19:49 UTC
Re: bug in date_select
Just want to note that I fixed the problem I describe below. It was most likely that my rails application''s script directory contained bins from 1.1.6, but also could have been a slight config issue. If you run into a similar problem try replacing your script/ directory with the one provided with the release you''re using (if you''ve frozen rails in vendor/rails, then use vendor/rails/railties/bin). Otherwise, replace your config/ files with the ones from the release you''re using. On Jan 5, 1:01 am, "abrah...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <abrah...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I don''t know who lumen is or what exactly your bug is, but I have > experienced a bug with various actionview related items. > > Specifically value(object) calls in form_helper*.rb > > ActionView::TemplateError: wrong number of arguments (1 for 0) > On line #32 of app/views/grants/_form.rhtml > > 29: <%= text_field ''grant'', ''ras_award_number'' %></p> > 30: > 31: <p><label for="grant_pi_id">Principle Investigator</label><br/> > 32: <%= collection_select ''grant'', ''pi_id'', @pis, ''id'', ''name'' > %></p> > 33: > 34: <p><label for="grant_project_title">Project Title</label><br/> > 35: <%= text_field ''grant'', ''project_title'' %></p> > > #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb:308:in > `value'' > > #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb:308:in > `to_collection_select_tag'' > > #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb:71:in > `collection_select'' > #{RAILS_ROOT}/app/views/grants/_form.rhtml:32:in > `_run_rhtml_47app47views47grants47_form46rhtml'' > > It does the same thing on datetime_select and other actionview calls. > > In the example above, the problem is in line 308 of > forms_options_helper.rb. If you comment out that line it works. > > My rails foo isn''t good enough to patch it right now and I don''t have > the energy to debug value(object), but I suspect this will be > caught swiftly and resolved. Although, I don''t know how it got into the > release to be honest. I would have thought someone''s tests would > have caught it. > > I''m running frozen rails 1.2RC2. > > Ringo wrote: > > I too have this problem. My ruby and rails are the same version as > > lumen. > > > Does anyone have a fix for this problem? > > > -- > > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
Mick Sharpe wrote:> I can''t help you with your problem, but you may want to look at > DateBocks which provides a much nicer way of entering dates, including a > pop-up calendar: > > http://www.oreillynet.com/ruby/blog/2006/09/datebocks_the_new_intuitive_da.htmlThanks Mike, DateBocks fix it and have more functions. The problem now is when i have multiple datebocks only the first one is working, the calender/date formating aren''t working for the rest. How to fix this? -- 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 -~----------~----~----~----~------~----~------~--~---
Hi, you should perform the following action instead to update your scripts, configs, and javascript: rake rails:update Good luck, -Conrad ps: Is there a Rails FAQ where one could enter this information? On 1/5/07, abrahams-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <abrahams-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Just want to note that I fixed the problem I describe below. It was > most likely that my rails application''s script directory contained bins > from 1.1.6, but also could have been a slight config issue. If you run > into a similar problem try replacing your script/ directory with the > one provided with the release you''re using (if you''ve frozen rails in > vendor/rails, then use vendor/rails/railties/bin). Otherwise, replace > your config/ files with the ones from the release you''re using. > > On Jan 5, 1:01 am, "abrah...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <abrah...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I don''t know who lumen is or what exactly your bug is, but I have > > experienced a bug with various actionview related items. > > > > Specifically value(object) calls in form_helper*.rb > > > > ActionView::TemplateError: wrong number of arguments (1 for 0) > > On line #32 of app/views/grants/_form.rhtml > > > > 29: <%= text_field ''grant'', ''ras_award_number'' %></p> > > 30: > > 31: <p><label for="grant_pi_id">Principle Investigator</label><br/> > > 32: <%= collection_select ''grant'', ''pi_id'', @pis, ''id'', ''name'' > > %></p> > > 33: > > 34: <p><label for="grant_project_title">Project Title</label><br/> > > 35: <%= text_field ''grant'', ''project_title'' %></p> > > > > > #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb:308:in > > `value'' > > > > > #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb:308:in > > `to_collection_select_tag'' > > > > > #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb:71:in > > `collection_select'' > > #{RAILS_ROOT}/app/views/grants/_form.rhtml:32:in > > `_run_rhtml_47app47views47grants47_form46rhtml'' > > > > It does the same thing on datetime_select and other actionview calls. > > > > In the example above, the problem is in line 308 of > > forms_options_helper.rb. If you comment out that line it works. > > > > My rails foo isn''t good enough to patch it right now and I don''t have > > the energy to debug value(object), but I suspect this will be > > caught swiftly and resolved. Although, I don''t know how it got into the > > release to be honest. I would have thought someone''s tests would > > have caught it. > > > > I''m running frozen rails 1.2RC2. > > > > Ringo wrote: > > > I too have this problem. My ruby and rails are the same version as > > > lumen. > > > > > Does anyone have a fix for this problem? > > > > > -- > > > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
spyridon.vasileiadis-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2007-Jan-06 20:46 UTC
Re: bug in date_select
Hi perhaps somewhere in the rails wiki like http://wiki.rubyonrails.com/rails/pages/FAQ though it needs some housekeeping. cheers, Spyros --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---