The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Problems with RJS

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jared Richardson

Posts: 1031
Nickname: jaredr
Registered: Jun, 2005

Jared Richardson is an author, speaker, and consultant who enjoys working with Ruby and Rails.
Problems with RJS Posted: May 30, 2007 10:15 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jared Richardson.
Original Post: Problems with RJS
Feed Title: Agile Artisans
Feed URL: http://agileartisans.com/main/rss
Feed Description: Jared's Blog
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jared Richardson
Latest Posts From Agile Artisans

Advertisement
I've had this problem repeatedly with RJS, and I'm not saying it's not something that I'm doing... in fact, if I had to take a bet on whether the problem is in my code or the RJS code, I'd bet it's my code. :)

Never the less, I've seen several pages online where this has been an issue for other people and it keeps coming back to haunt me, so here's my fix.

When you're using RJS to do JavaScript magic and you add something simple like

page.replace "main", :partial => "update_student"

and the JavaScript just shows up on the page you're trying to update, then you've found this issue. You see something like this in the browser:

try {
Element.replace("main", "
\r\n

\r\n Your updates have been recorded\r\n

\r\n
"); } catch (e) { alert('RJS error:\n\n' + e.toString()); alert('Element.replace(\"

Read: Problems with RJS

Topic: Getting started with Streamlined (part 1) Previous Topic   Next Topic Topic: Customize the Colours of the Ruby In Steel IDE

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use