Up-dates


#1

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?


#2

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.


#3

Mohammad wrote:

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

What does your chatroom action look like?


#4

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

#5

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?