I think I''ve found a bug with Edge. I''m trying out Ryan Bates'' multi-object form technique shown in one of his Rails-casts (railscasts.com/episodes/75). If you use a fields_for similar to that shown (here: http://pastie.caboo.se/110480), you get a Server Error 500: ------ Status: 500 Internal Server Error Conflicting types for parameter containers. Expected an instance of Hash but found an instance of Array. This can be caused by colliding Array and Hash parameters like qs[]=value&qs[key]=value. ------ The problem appears to be that Rails doesn''t know to put the date- select information into an Array. Can anyone else verify this? James Herdman --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Koziarski
2007-Oct-24 20:38 UTC
Re: Ryan Bates'' Multi-object Forms and the date_select
> The problem appears to be that Rails doesn''t know to put the date- > select information into an Array.That certainly looks like it. Have a look at trac and see if anyone else has reported this, otherwise you''ll need to open a new ticket yourself. Do you feel like taking a crack at fixing it too ;) http://dev.rubyonrails.org/newticket> Can anyone else verify this? > > James Herdman > > > > >-- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
You bet I do! However... not today :P For future Googlers, until I can get a good work around what I''m doing is using the snazzy Chronic gem. This means I can use a simple text field and parse the _before_type_cast version into a Date (or Time) object. James On Oct 24, 4:38 pm, "Michael Koziarski" <mich...@koziarski.com> wrote:> > The problem appears to be that Rails doesn''t know to put the date- > > select information into an Array. > > That certainly looks like it. Have a look at trac and see if anyone > else has reported this, otherwise you''ll need to open a new ticket > yourself. Do you feel like taking a crack at fixing it too ;) > > http://dev.rubyonrails.org/newticket > > > Can anyone else verify this? > > > James Herdman > > -- > Cheers > > Koz--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Future Googlers, I was wrong : ) On Oct 24, 5:02 pm, "James H." <james.herd...@gmail.com> wrote:> You bet I do! However... not today :P > > For future Googlers, until I can get a good work around what I''m doing > is using the snazzy Chronic gem. This means I can use a simple text > field and parse the _before_type_cast version into a Date (or Time) > object. > > James > > On Oct 24, 4:38 pm, "Michael Koziarski" <mich...@koziarski.com> wrote: > > > > The problem appears to be that Rails doesn''t know to put the date- > > > select information into an Array. > > > That certainly looks like it. Have a look at trac and see if anyone > > else has reported this, otherwise you''ll need to open a new ticket > > yourself. Do you feel like taking a crack at fixing it too ;) > > >http://dev.rubyonrails.org/newticket > > > > Can anyone else verify this? > > > > James Herdman > > > -- > > Cheers > > > Koz--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Mike Barsalou
2007-Oct-25 16:32 UTC
Re: Ryan Bates'' Multi-object Forms and the date_select
On Oct 24, 1:22 pm, "James H." <james.herd...@gmail.com> wrote:> Future Googlers, I was wrong : ) >Wrong about what, using the Cronic gem? Mike B. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Hey Mike. I meant my theory looks to be incorrect: that the date_select params were the source of the trouble. By using the Chronic gem I thought I could get rid of the date_select field and then all would be well, but that didn''t work. It appears that it''s the combination of using select fields and text fields that causes the trouble. I''m not really sure how to solve the problem at the moment. I''m poking around in the AbstractRequest.parse_request_parameters code, but I can''t even get simple requests to work in IRB, so it''s taking me a little longer than I''d like it to be. James On Oct 25, 12:32 pm, Mike Barsalou <barj...@attglobal.net> wrote:> On Oct 24, 1:22 pm, "James H." <james.herd...@gmail.com> wrote: > > > Future Googlers, I was wrong : ) > > Wrong about what, using the Cronic gem? > > Mike B.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Okay, Googlers. I have this figured out. I don''t have a good solution, but I have a work-around until I can write a patch. You''ll notice in Ryan Bate''s method that he has you use an ":index => nil" option on text_fields for your fields_for. This option is _not_ recognized by the select helper. Until I can write a patch, you need to use the select_tag helper as follows: select_tag(''project[task_attributes][][some_selectable_attribute]'', options_for_select(some_options, selected_option) It''s ugly, it''s fragile, and it''s not DRY. However, it''ll keep you moving until I can get a patch written this weekend. James On Oct 25, 12:41 pm, "James H." <james.herd...@gmail.com> wrote:> Hey Mike. > > I meant my theory looks to be incorrect: that the date_select params > were the source of the trouble. > > By using the Chronic gem I thought I could get rid of the date_select > field and then all would be well, but that didn''t work. It appears > that it''s the combination of using select fields and text fields that > causes the trouble. > > I''m not really sure how to solve the problem at the moment. I''m > poking around in the AbstractRequest.parse_request_parameters code, > but I can''t even get simple requests to work in IRB, so it''s taking me > a little longer than I''d like it to be. > > James > > On Oct 25, 12:32 pm, Mike Barsalou <barj...@attglobal.net> wrote: > > > On Oct 24, 1:22 pm, "James H." <james.herd...@gmail.com> wrote: > > > > Future Googlers, I was wrong : ) > > > Wrong about what, using the Cronic gem? > > > Mike B.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Alexander Simonov
2007-Dec-14 12:11 UTC
Re: Ryan Bates'' Multi-object Forms and the date_select
Hello! I have same trouble :( Does you already write patch for this? I''m use rails 2.0.1 Thank you! James Herdman wrote:> Okay, Googlers. I have this figured out. I don''t have a good > solution, but I have a work-around until I can write a patch. > > You''ll notice in Ryan Bate''s method that he has you use an ":index => > nil" option on text_fields for your fields_for. This option is _not_ > recognized by the select helper. Until I can write a patch, you need > to use the select_tag helper as follows: > > select_tag(''project[task_attributes][][some_selectable_attribute]'', > options_for_select(some_options, selected_option) > > It''s ugly, it''s fragile, and it''s not DRY. However, it''ll keep you > moving until I can get a patch written this weekend. > > James-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
James Herdman
2007-Dec-14 15:12 UTC
Re: Ryan Bates'' Multi-object Forms and the date_select
Hey Alex! I haven''t yet. I''ve got a little busy as of late. Here''s the thing: this is already supported, it just isn''t revealed. What I''d suggest doing in the mean time (I _will_ write the patch this weekend for you), is using a text field and leveraging the Chronic gem to convert plain-English time phrases into Date or Time objects. James H. On Dec 14, 2007 7:11 AM, Alexander Simonov < ruby-forum-incoming@andreas-s.net> wrote:> > Hello! > > I have same trouble :( > > Does you already write patch for this? > I''m use rails 2.0.1 > Thank you! > > > James Herdman wrote: > > Okay, Googlers. I have this figured out. I don''t have a good > > solution, but I have a work-around until I can write a patch. > > > > You''ll notice in Ryan Bate''s method that he has you use an ":index => > > nil" option on text_fields for your fields_for. This option is _not_ > > recognized by the select helper. Until I can write a patch, you need > > to use the select_tag helper as follows: > > > > select_tag(''project[task_attributes][][some_selectable_attribute]'', > > options_for_select(some_options, selected_option) > > > > It''s ugly, it''s fragile, and it''s not DRY. However, it''ll keep you > > moving until I can get a patch written this weekend. > > > > James > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Alexander Simonov
2007-Dec-15 09:00 UTC
Re: Ryan Bates'' Multi-object Forms and the date_select
Hello James! I''m already fix issue with date items. All works with creating, but if i update entryes i get error - Symbol as array index. James Herdman wrote:> Hey Alex! > I haven''t yet. I''ve got a little busy as of late. Here''s the thing: > this > is already supported, it just isn''t revealed. > > What I''d suggest doing in the mean time (I _will_ write the patch this > weekend for you), is using a text field and leveraging the Chronic gem > to > convert plain-English time phrases into Date or Time objects. > > James H. > > On Dec 14, 2007 7:11 AM, Alexander Simonov <-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Please attach changes you have made to the ticket in Rails Trac so that someone can check and fix it. On 15 Dec. 2007, at 11:00, Alexander Simonov wrote:> > Hello James! > I''m already fix issue with date items. > All works with creating, but if i update entryes i get error - > Symbol as > array index.MK --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
To put this to bed (for now), the problem is how people are _expecting_ to use the "select" helper. They''re expecting to use it like this: select("album[]", "genre", %w[rap rock country], :index => nil) When in fact they _should_ be using it like this: select("album[]", "genre", %w[rap rock country], {}, { :index => nil } In summation, this feature is already supported, it''s just not as expected. I''ll be submitting a patch with documentation enhancements and a new test to show an example of this usage. James H. On Dec 15, 4:36 am, Michael Klishin <michael.s.klishin.li...@gmail.com> wrote:> Please attach changes you have made to the ticket in Rails Trac so > that someone can check and fix it. > > On 15 Dec. 2007, at 11:00, Alexander Simonov wrote: > > > > > Hello James! > > I''m already fix issue with date items. > > All works with creating, but if i update entryes i get error - > > Symbol as > > array index. > > MK--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
See patch here: http://dev.rubyonrails.org/ticket/10523 James H. On Dec 16, 1:46 pm, "James H." <james.herd...@gmail.com> wrote:> To put this to bed (for now), the problem is how people are > _expecting_ to use the "select" helper. They''re expecting to use it > like this: > > select("album[]", "genre", %w[rap rock country], :index => nil) > > When in fact they _should_ be using it like this: > > select("album[]", "genre", %w[rap rock country], {}, { :index => nil } > > In summation, this feature is already supported, it''s just not as > expected. I''ll be submitting a patch with documentation enhancements > and a new test to show an example of this usage. > > James H. > > On Dec 15, 4:36 am, Michael Klishin > > <michael.s.klishin.li...@gmail.com> wrote: > > Please attach changes you have made to the ticket in Rails Trac so > > that someone can check and fix it. > > > On 15 Dec. 2007, at 11:00, Alexander Simonov wrote: > > > > Hello James! > > > I''m already fix issue with date items. > > > All works with creating, but if i update entryes i get error - > > > Symbol as > > > array index. > > > MK--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
I had a similar issue to the one that you''re having. In my case, date_select was handling the auto-indexing of a new record incorrectly. See my patch: http://dev.rubyonrails.org/ticket/10551 Not sure if this helps but someone referred me to this post when they heard about the issue I had patched. Best, Rick On Dec 16, 2:08 pm, "James H." <james.herd...@gmail.com> wrote:> See patch here:http://dev.rubyonrails.org/ticket/10523 > > James H. > > On Dec 16, 1:46 pm, "James H." <james.herd...@gmail.com> wrote: > > > To put this to bed (for now), the problem is how people are > > _expecting_ to use the "select" helper. They''re expecting to use it > > like this: > > > select("album[]", "genre", %w[rap rock country], :index => nil) > > > When in fact they _should_ be using it like this: > > > select("album[]", "genre", %w[rap rock country], {}, { :index => nil } > > > In summation, this feature is already supported, it''s just not as > > expected. I''ll be submitting a patch with documentation enhancements > > and a new test to show an example of this usage. > > > James H. > > > On Dec 15, 4:36 am, Michael Klishin > > > <michael.s.klishin.li...@gmail.com> wrote: > > > Please attach changes you have made to the ticket in Rails Trac so > > > that someone can check and fix it. > > > > On 15 Dec. 2007, at 11:00, Alexander Simonov wrote: > > > > > Hello James! > > > > I''m already fix issue with date items. > > > > All works with creating, but if i update entryes i get error - > > > > Symbol as > > > > array index. > > > > MK--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---