Remote function

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


Try something like this…

In the view

link_to_remote ‘Select’,
:url => {:action => ‘generate_preview’},
:with => “‘text_area_value=’ +

In the controller

def generate_preview
textAreaValue = params[‘text_area_value’]


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.

great it works like a charm!


On Sep 19, 6:41 pm, Dave S. [email protected]