Hi, :with => ''js_variable'' which Rails turns into a Prototype Ajax call with option parameter: js_variable and which can be retrieved in the controller as request.raw_post, does not work in the current SVN prototype because an equals sign is appended to the post string. Should I submit a patch to Prototype''s toQueryString function, or is such lazy use of raw_post no longer supported, and all apps should change to :with ''"js_variable="+js_variable" and params[:js_variable] ? BTW, I''ve switched to Prototype SVN to check out the new Internet Explorer-compatible table update code. Is this working OK? -- We develop, watch us RoR, in numbers too big to ignore. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2006-Nov-13 07:38 UTC
Re: Ajax parameter issue in Prototype SVN (1.5RC2)
Mark Reginald James a écrit :> :with => ''js_variable'' > > which Rails turns into a Prototype Ajax call with option > > parameter: js_variableActually, what Rails does with this is define the name of the HTTP request parameter that will be used for sending the recently-changed value of the field/form you''re observing.> and which can be retrieved in the controller as request.raw_post,Why on Earth wouldn''t you use @params[:js_variable]?!> does not work in the current SVN prototype because an equals > sign is appended to the post string.Of course it is, as per docs, specs, and common sense. There should also be the field''s VALUE sent there, right after the ''='' sign. If the value is empty at the time, of course there won''t be anything.> Should I submit a patch to Prototype''s toQueryString function,.toQueryString() is perfectly fine, especially on SVN. What exactly are you trying to do? You sound like you just don''t use :with properly. Can you provide us with some context here? ''best, -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Mark Reginald James
2006-Nov-13 08:43 UTC
Re: Ajax parameter issue in Prototype SVN (1.5RC2)
Christophe Porteneuve wrote:> Mark Reginald James a écrit : >> :with => ''js_variable'' >> >> which Rails turns into a Prototype Ajax call with option >> >> parameter: js_variable > > Actually, what Rails does with this is define the name of the HTTP > request parameter that will be used for sending the recently-changed > value of the field/form you''re observing.Thank you Christophe for your reply. To significantly save on duplication, I''ve factored out my erb remote_function calls from a large number of triggering document links into a page-wide javascript function. In this context the js variable I wish to send remotely is not the "value" that the Rails helper expects (though I could certainly rename to make it so). So in this context I can''t write :with => ''param_key'' to make params[:param_key] available in my controller, because this will try to send the non-existent value variable. I instead have to write :with =>''"param_key="+js_variable'' In contrast, :with => ''js_variable'' works in conjunction with request.raw_post.>> and which can be retrieved in the controller as request.raw_post, > > Why on Earth wouldn''t you use @params[:js_variable]?!Because it''s much easier to type the shorter :with option.>> does not work in the current SVN prototype because an equals >> sign is appended to the post string. > > Of course it is, as per docs, specs, and common sense. There should > also be the field''s VALUE sent there, right after the ''='' sign. If the > value is empty at the time, of course there won''t be anything. > >> Should I submit a patch to Prototype''s toQueryString function, > > .toQueryString() is perfectly fine, especially on SVN.I''m just saying (and warning) that what once worked now doesn''t, and was asking whether my usage was a quirk that just happened to work, or whether the breakage was unintentional and a patch is in order.> What exactly are you trying to do? You sound like you just don''t use > :with properly. Can you provide us with some context here?See above. -- We develop, watch us RoR, in numbers too big to ignore. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2006-Nov-13 09:21 UTC
Re: Ajax parameter issue in Prototype SVN (1.5RC2)
Hey Mark, Mark Reginald James a écrit :> I''m just saying (and warning) that what once worked now doesn''t, > and was asking whether my usage was a quirk that just happened to > work, or whether the breakage was unintentional and a patch is > in order.Well, I can''t quite say. The :with option is certainly *not* intended for this, so your using it that way is kinda of a quirk. The Hash.toQueryString() function is appropriate and properly adds the ''='' sign as per HTTP/HTML conformance specs and expectations. So you''ll just have to either use: @params.include?(''js_variable'') or compare raw_post to ''js_variable=''. -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Martin Bialasinski
2006-Nov-13 10:07 UTC
Re: Ajax parameter issue in Prototype SVN (1.5RC2)
On 11/13/06, Mark Reginald James <mrj-bzGI/hKkdgQnC9Muvcwxkw@public.gmane.org> wrote:> >> does not work in the current SVN prototype because an equals > >> sign is appended to the post string. > > > > Of course it is, as per docs, specs, and common sense. There should > > also be the field''s VALUE sent there, right after the ''='' sign. If the > > value is empty at the time, of course there won''t be anything. > > > >> Should I submit a patch to Prototype''s toQueryString function, > > > > .toQueryString() is perfectly fine, especially on SVN. > > I''m just saying (and warning) that what once worked now doesn''t, > and was asking whether my usage was a quirk that just happened to > work, or whether the breakage was unintentional and a patch is > in order.Your usage depended on a bug in .toQueryString() that was fixed recently. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Mark Reginald James
2006-Nov-13 15:28 UTC
Re: Ajax parameter issue in Prototype SVN (1.5RC2)
Martin Bialasinski wrote:> Your usage depended on a bug in .toQueryString() that was fixed recently.Thanks to you both. I''ll change all my code to work with the new toQueryString behaviour. -- We develop, watch us RoR, in numbers too big to ignore. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---