# Up-dates

**URL:** <https://www.ruby-forum.com/t/up-dates/94296>\
**Category:** Rails\
**Created:** [April 28, 2006, 12:58am UTC](https://www.ruby-forum.com/t/up-dates/94296 "2006-04-28T00:58:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohammad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mohammad](https://www.ruby-forum.com/u/mohammad)\
**Post date:** [April 28, 2006, 12:58am UTC](https://www.ruby-forum.com/t/up-dates/94296/1 "2006-04-28T00:58:44Z")

</div>

I started working on a chat program but, I’m having this problem

chatroom.rhtml

\<%= periodically\_call\_remote( :update =\> "chatroom", :url =\> {:action =\> :chat }, :frequency =\> 2) %\>

chat.rhtml

# \<%= @chat.room %\> room.

| 
```
<%=h @chat.chat %>
```
 |

but, when I call chatroom it dosn’t work but chat does, what is the  
problem here?

---

<div class="post-metadata">

**Author:** ![mohammad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mohammad](https://www.ruby-forum.com/u/mohammad)\
**Post date:** [April 28, 2006, 5:44am UTC](https://www.ruby-forum.com/t/up-dates/94296/2 "2006-04-28T05:44:16Z")

</div>

Mohammad wrote:

> I started working on a chat program but, I’m having this problem
> 
> chatroom.rhtml
> 
> \<%= periodically\_call\_remote( :update =\> "chatroom", :url =\> {:action =\> :chat }, :frequency =\> 2) %\>
> 
> chat.rhtml
> 
> # \<%= @chat.room %\> room.
> 
> | 
> ```
> <%=h @chat.chat %>
> ```
> |
> 
> but, when I call chatroom it dosn’t work but chat does, what is the  
> problem here?

Can anyone help me with this I have to have my project done this week.

---

<div class="post-metadata">

**Author:** ![mohammad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mohammad](https://www.ruby-forum.com/u/mohammad)\
**Post date:** [April 28, 2006, 1:04pm UTC](https://www.ruby-forum.com/t/up-dates/94296/3 "2006-04-28T13:04:57Z")

</div>

Mohammad wrote:

> > 
> 
> Can anyone help me with this I have to have my project done this week.

What does your chatroom action look like?

---

<div class="post-metadata">

**Author:** ![mohammad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mohammad](https://www.ruby-forum.com/u/mohammad)\
**Post date:** [April 28, 2006, 1:52pm UTC](https://www.ruby-forum.com/t/up-dates/94296/4 "2006-04-28T13:52:17Z")

</div>

loose :update in youre call and set an actual

 to  
update the contents in youre controller.

def chat  
@data = something  
render :update do |page|  
page.replace\_html ‘new’, @data  
end  
end

now ‘new’ is a

 in youre chat.rhtml file with an id=‘new’  
or something more descriptive of course

---

<div class="post-metadata">

**Author:** ![mohammad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mohammad](https://www.ruby-forum.com/u/mohammad)\
**Post date:** [April 28, 2006, 3:19pm UTC](https://www.ruby-forum.com/t/up-dates/94296/5 "2006-04-28T15:19:51Z")

</div>

I did what you said Peter but look at this,  
try {  
Element.update(“data”, “

# Welcome to chatroom Service
  
  

| Reminder: Please make sure  
the awnser is not in the “FAQ”:/questions\r\nHaroon: I need help, my  
mail for actavation isn’t going out.\r\nAdmin: For _strong_ secuirty we  
must ask you a couple of questions.\r\nHaroon: Okay.\r\nAdmin: On your  
contract it says “ID #??”\r\nHaroon: 982731\r\nAdmin: Your  
name.\r\nHaroon: Haroon.\r\nAdmin: Secuirty word:\r\nHarron: _Password  
has been blocked by admin_\r\nAdmin: Thank you, I will now look into  
it. |

”);  
} catch (e) { alert(‘RJS error:\n\n’ + e.toString());  
alert(‘Element.update(“data”, “
# Welcome to chatroom Service
  
  
\<table border=‘2’\>Reminder: Please make  
sure the awnser is not in the \“FAQ\”:/questions\r\nHaroon: I need  
help, my mail for actavation isn’t going out.\r\nAdmin: For _strong_  
secuirty we must ask you a couple of questions.\r\nHaroon:  
Okay.\r\nAdmin: On your contract it says \“ID #??\”\r\nHaroon:  
982731\r\nAdmin: Your name.\r\nHaroon: Haroon.\r\nAdmin: Secuirty  
word:\r\nHarron: _Password has been blocked by admin_\r\nAdmin: Thank  
you, I will now look into it.”);’); throw e }

Thats what it show. Any clue what that means? Why is it not doing the  
HTML? Here is what my controller looks like:

def chat  
@chat = Chat.find(:first)  
@data = RedCloth.new(I have done with and without this still the same)  
"

# Welcome to chatroom " + @chat.room + “
  
  

| ” + @chat.chat + “ |

”  
render :update do |page|  
page.replace\_html ‘data’, @data  
end  
end

And here is my rhtml file.

Any clues?
