Ruby Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesRuby Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old September 12th, 2007, 12:45 PM
Morpher Morpher is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 5 Morpher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 20 m 7 sec
Reputation Power: 0
Client Updating

I have a Shout/Chat box using Ajax Ruby on Rails.
The chat goes in just fine and uses Ajax with ease.

What I would like to have happen, instead of refreshing page every X seconds.
Is to make it post changes have been made to clients using the Shout Box.

Can any one help me get this going?

Below is the code in my rtml.

Code:
<div class="tableborder">
            <div class="maintitle"><b>ShoutBox!</b></div>
              Last 10 Shouts:
              <hr size="1" align="left" width="100%" color="blue">
                <div id="shouts" class="shoutpad" style="overflow:auto;">
                <% @shoutLines = Shout.find(:all, :order => 'timestamp DESC', :limit => 10) %>
                  <% @shoutLines.each do |sl| %>
                  <% @user = User.find(sl.user_id) %>
                  <div class="hlight"><strong><%=h @user.username %></strong> on <%=h sl.timestamp %></div>
                   <%=h sl.text %>
                  <br /><br/>
                  <% end %>
              </div>

              <hr size="1" align="left" width="100%" color="blue">
              <div class="tablepad">
                 <form action="../shout/create" method="post">
                       <b>Message: </b>
                       <input id="shout_message" name="shout[text]" size="20" type="text" value=""/>
                       <%= submit_tag 'Send' %>
                     </form>
               </div>
          </div>


I've been playing around with prototype.js with no luck.
I think that will make it work the way I need it.

Note: Eventually I need to figure out how to keep the scrolling there too, not just the last 10 shouts.

Thanks in advance

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesRuby Programming > Client Updating


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway