render :update just displays code from JavaScriptGenerator

I have looked around and seen similar problems but have not yet found
a solution to this.

Relatively new to RoR, I am trying to use render :update to modify the
displayed page in the browser.

No matter what I put in the render :update block, all I see is the
code wrapped in the 'try' statement that the generator creates. It's
not executed, it's just displayed on the browser. I'm sure there is
something basic I'm missing here.

Any insight?


As an example, here's the code in my controller:

  def destroy
    @rehearsal = Rehearsal.find(params[:id])
    render :update do |page| "delreh", "rehearsal_#{}"

and after this method is called, this is what I see on the browser:

try {
} catch (e) { alert('RJS error:\n\n' + e.toString());
alert('delreh(\"rehearsal_15\");'); throw e }

anyone please help. Thanks!

As an example, here's the code in my controller:

def destroy
@rehearsal = Rehearsal.find(params[:id])
render :update do |page| "delreh", "}"

What does the link that invokes this look like ? You need to use
link_to_remote (or similar) and you can't use the update option to