I have a form to edit a page, with its nice save button. Since it''s in textile I''m writing a preview button which renders the content to html and put it in a div. But, how can I pass to the remote function the current content of the text area? something like this remote function( update => mydiv, ulr => (:action => textiler), arguments => (text => textarea.value) ) of course that doesn''t work, just to make myself understood bye thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Try something like this... # In the view link_to_remote ''Select'', :url => {:action => ''generate_preview''}, :with => "''text_area_value='' + document.getElementById(''someTextAreaID'').value" # In the controller def generate_preview textAreaValue = params[''text_area_value''] #other_stuff end The :with option isn''t very well documented... It works with link_to_remote, but doesn''t seem to work with form_remote. It might work with some button_* helpers, or whatever... I don''t know. -- 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 -~----------~----~----~----~------~----~------~--~---
great it works like a charm! thanks On Sep 19, 6:41 pm, Dave Smith <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Try something like this... > > # In the view > link_to_remote ''Select'', > :url => {:action => ''generate_preview''}, > :with => "''text_area_value='' + > document.getElementById(''someTextAreaID'').value" > > # In the controller > def generate_preview > textAreaValue = params[''text_area_value''] > > #other_stuff > end > > The :with option isn''t very well documented... It works with > link_to_remote, but doesn''t seem to work with form_remote. It might > work with some button_* helpers, or whatever... I don''t know. > -- > 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 -~----------~----~----~----~------~----~------~--~---