# Directing command output to a view

**URL:** <https://www.ruby-forum.com/t/directing-command-output-to-a-view/176228>\
**Category:** Rails\
**Created:** [September 27, 2009, 1:15pm UTC](https://www.ruby-forum.com/t/directing-command-output-to-a-view/176228 "2009-09-27T13:15:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![petrjanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee7513/32.png) [@petrjanda](https://www.ruby-forum.com/u/petrjanda)\
**Post date:** [September 27, 2009, 1:15pm UTC](https://www.ruby-forum.com/t/directing-command-output-to-a-view/176228/1 "2009-09-27T13:15:10Z")

</div>

Hi all,

Ive recently designed a system that is started from the command line.  
ie.  
/usr/local/bin/system.rb

The system is a long running task that outputs messages via “puts” to  
the shell as its being executed.

I need to run this command from a rails application so that 1) it doesnt  
block .ie user gets a “please wait” screen 2) and more importantly I  
want the output of the command sent in real-time or near real-time to  
the view, under the “please wait” message. And when the command exits,  
the user is redirected to another view.

Any ideas whats the best way to do this?

Petr
