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 :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.
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.