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?

Thanks,
Michael

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

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

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

try {
delreh(“rehearsal_15”);
} catch (e) { alert(‘RJS error:\n\n’ + e.toString());
alert(‘delreh(“rehearsal_15”);’); throw e }

anyone please help. Thanks!

On Apr 15, 3:45 am, mstoth [email protected] wrote:

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

def destroy
@rehearsal = Rehearsal.find(params[:id])
render :update do |page|
page.call “delreh”, “[email protected]}”
end
end

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

Fred