Calling an rjs template from a normal action?

If I had an action called ‘delete’ in a controller that’s called by a
normal post request, would it be possible to call an rjs template from
it?
Something like:

def delete
# delete whatever
render
end

or:

def delete
# delete whatever
render( :action => ‘delete.rjs’ )
end

or:

def delete
# delete whatever
render :update do |page|
page.call( ‘myFunction’ )
end
end

Of course, none of the above work, as I’ve tried them.
I also tried to do this in response to a submit from a remote_form, but
still had no luck.
Can anyone advise?
Cheers,
Doug.

On 15 Sep 2006, at 15:57, Doug L. wrote:

Of course, none of the above work, as I’ve tried them.
I also tried to do this in response to a submit from a remote_form,
but
still had no luck.
Can anyone advise?

Calling it from a normal post wouldn’t be logical, it’s not what RJS
was designed for. If you’re looking for javascript events on a page
load, UJS4Rails (which is great for just about everything btw) could
help you out: you can attach javascript to events and even write them
just like you would an RJS action.

http://www.ujs4rails.com/

Best regards

Peter De Berdt