# Model/View communication

**URL:** <https://www.ruby-forum.com/t/model-view-communication/145778>\
**Category:** Rails\
**Created:** [August 13, 2008, 9:42pm UTC](https://www.ruby-forum.com/t/model-view-communication/145778 "2008-08-13T21:42:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 13, 2008, 9:42pm UTC](https://www.ruby-forum.com/t/model-view-communication/145778/1 "2008-08-13T21:42:32Z")

</div>

Is there a way other than the DB to get messaging to the view while in  
a method in the model? I have an ajax routing that does some testing  
on some eqpt and I would like to provide some feedback in the view as  
to what is going on with the testing.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 14, 2008, 4:35am UTC](https://www.ruby-forum.com/t/model-view-communication/145778/2 "2008-08-14T04:35:17Z")

</div>

On Aug 13, 2:41 pm, Me [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Is there a way other than the DB to get messaging to the view while in  
> a method in the model? I have an ajax routing that does some testing  
> on some eqpt and I would like to provide some feedback in the view as  
> to what is going on with the testing.

You generally need to periodically poll the server to find out what  
the status is. So you do need to store the status somewhere (usually  
the database) that can be accessed by a background ajax call that can  
update your browser UI.

Check out periodically\_call\_remote:  
[http://api.rubyonrails.com/classes/ActionView/Helpers/PrototypeHelper.html#M000959](http://api.rubyonrails.com/classes/ActionView/Helpers/PrototypeHelper.html#M000959)

Hope this helps…?

Jeff

REST with Rails for beginners  
Oct 4, 2008  
Austin, Texas  
[http://www.purpleworkshops.com/workshops/rest-and-web-services](http://www.purpleworkshops.com/workshops/rest-and-web-services)
