sw0rdfish
2006-Oct-24 01:04 UTC
in_place_editor_field fun! Possible to pass more parameters?
Hey guys... I''m wondering if there is way to submit extra parameters with <%= in_place_editor_field :model, :attribute %> For example, if I wanted to submit the current time or something like that to run through my own custom set_model_attribute method that is called when the editor is saved. Thanks in advance p.s. sorry if this is a double post, I think my first attempt failed. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Daniel N
2006-Oct-24 04:53 UTC
Re: in_place_editor_field fun! Possible to pass more parameters?
On 10/24/06, sw0rdfish <santia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hey guys... > > I''m wondering if there is way to submit extra parameters with > > <%= in_place_editor_field :model, :attribute %> > > For example, if I wanted to submit the current time or something like > that to run through my own custom set_model_attribute method that is > called when the editor is saved.The :with option is used to construct the parameter string to return> :with:JavaScript snippet that should return what is to be sent in the AJAX > call, form is an implicit parameterSo you need to have a string that will eval to Javascript on the client side. Hope that''s what your after :) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
sw0rdfish
2006-Oct-24 05:15 UTC
Re: in_place_editor_field fun! Possible to pass more parameters?
I''m pretty sure that is what I''m after, and I tried using that 100 times, maybe I''m just useless. How would I go about passing a string using the "with" command? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Daniel N
2006-Oct-24 05:25 UTC
Re: in_place_editor_field fun! Possible to pass more parameters?
On 10/24/06, sw0rdfish <santia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > I''m pretty sure that is what I''m after, and I tried using that 100 > times, maybe I''m just useless. > > How would I go about passing a string using the "with" command?My javascript.fu is not strong. It''s my understanding that you need to construct the parameters for the url in javascript. I''m sure there are nicer ways of doing this. .... :with => "''param_name='' + $(''dom_id'').value + ''¶m_2_name='' + some_js_function_that_returns_an_encoded_string()" I believe something like that. I think there are things in prototype.js to assist with this. Serialize on forms may help. You need a string within a string. The above starts with a " for rubys sake, then immediately has a single '' for js. Anything in the single will be a literal for js, and anything just in the double " will be executed in js as a function. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
sw0rdfish
2006-Oct-24 05:39 UTC
Re: in_place_editor_field fun! Possible to pass more parameters?
I''ll check it out. Thanks for your help. Although I guarantee my "javascript.fu" is worse than yours. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
sw0rdfish
2006-Oct-24 15:22 UTC
Re: in_place_editor_field fun! Possible to pass more parameters?
Found a solution, for Archieval purposes... just use RJS files, here''s a cool walk through; http://www.shanesbrain.net/articles/2006/01/19/in-place-editor-with-rjs-templates It''s 100 times easier. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Daniel N
2006-Oct-24 15:33 UTC
Re: in_place_editor_field fun! Possible to pass more parameters?
On 10/25/06, sw0rdfish <santia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Found a solution, > > for Archieval purposes... just use RJS files, here''s a cool walk > through; > > > http://www.shanesbrain.net/articles/2006/01/19/in-place-editor-with-rjs-templates > > It''s 100 times easier.That is much nicer. Thanx for linking --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---