Forum: Ruby on Rails Render Partial virtual pages

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
5c26728d2db67a78f9097f63ed3c8d37?d=identicon&s=25 Bing Tan (sombrero)
on 2006-05-02 10:28
Hi guys,

We all know this snippet of code:

render(:partial => 'page')

here's my problem, I think I need to create a render where in the page
will be dynamic. example, page = username and my code will need to
render(:partial => 'username').

is this even possible?

My issue is with a chat application I'm trying to do. I already have
multiple div's and they all have unique names already. Now the problem
lies herein, I have a page with multiple div layers to represent each
person I'm talking to. When I send a message to one person, it goes into
my app and I have a listening module that will render whatever got
picked-up. But because my controllers renders to the same field of
render(:partial => 'page'), all of the divs get updated and the message
I send to one person gets sent to all people as well...

hope you guys could give me some insight.


This topic is locked and can not be replied to.