From: Ruby Student Date: 2013-06-14T22:14:25+09:00 Subject: Re: Can I use Sinatra to render dynamic pages? --047d7b67735879bdda04df1d067c Content-Type: text/plain; charset=ISO-8859-1 Well, I got some good suggestions from everyone here. I thank you all for that! Now I just need to analyze each suggestion and pick he easiest for me. I am not by any mean a mature ruby programmer and I like to do things as easy and simple as possible. If Sinatra is overkill for what I want, perhaps I should look into something different. I was wondering if TomCat might be what I need. Anyway, the entire affair is kind of confusing to me as this is the first time I deal with this type of thing. As I said, I am very grateful to all of you for taking the time to answer my post. On Thu, Jun 13, 2013 at 11:55 PM, Nicholas Van Weerdenburg < vanweerd@gmail.com> wrote: > You should be able to do this without JavaScript by using streaming. > > Sinatra has a streaming API as of 1.3. Rails 4.0 is adding a "live" mode > for similar. > > However you need to use a supporting web server and hook into the event > loop (which Rack exposes). > > https://gist.github.com/rkh/1476463 offers an example, but note that the > heroku app is broken (look at the comments for a link to a patched version). > > Nick > > > On Thu, Jun 13, 2013 at 5:41 PM, Ruby Student wrote: > >> Hell Team, >> >> I wrote a very simple dashboard using *shoes* which basically displays >> statistics, every second, of certain type of messages arriving at a queue >> under *MQ*. But in order for anyone to use it they have to install *Ruby*, >> *shoes *and its requirements. So I started experimenting with *Sinatra *to >> re-write my simple application so anyone could point their *browser* and >> get the dashboard displayed. I went over the first *basic Sinatra*tutorial but everything appears to be static. Is there any example out >> there that shows *Sinatra* dynamically refreshing the page continuously >> with new information, in my case message queues information? >> >> In other words, once the user successfully get the page displayed, from >> that point on I want the content to be refreshed dynamically with the new >> information without user intervention. >> >> Thank you >> >> -- >> Ruby Student >> > > -- Ruby Student --047d7b67735879bdda04df1d067c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Well, I got some good suggestions from everyone = here. I thank you all for that!
Now I just need to analyze each su= ggestion and pick he easiest for me. I am not by any mean a mature ruby pro= grammer and I like to do things as easy and simple as possible. If Sinatra = is overkill for what I want, perhaps I should look into something different= . I was wondering if TomCat might be what I need. Anyway, the entire affair= is kind of confusing to me as this is the first time I deal with this type= of thing.

As I said, I am very grateful to all of you for taking the time t= o answer my post.



On Thu, Jun 13, 2013 at 11:55 PM, Nicholas Van Weerdenbur= g <vanweerd@gmail.com> wrote:
You should be able to = do this without JavaScript by using streaming.

Sin= atra has a streaming API as of 1.3. Rails 4.0 is adding a "live" = mode for similar.

However you need to use a supporting web server and hook into th= e event loop (which Rack exposes).

https://gist.github.com/= rkh/1476463 offers an example, but note that the heroku app is broken (= look at the comments for a link to a patched version).

Nick

On Thu, Jun 13, 2013 at 5:41= PM, Ruby Student <ruby.student@gmail.com> wrote:
Hell Team,

I wrote a very simple dashboard using <= b>shoes which basically displays statistics, every second, of certain t= ype of messages arriving at a queue under MQ. But in or= der for anyone to use it they have to install Ruby, = shoes and its requirements. So I started experimenting with Sinatra = to re-write my simple application so anyone could point their browse= r and get the dashboard displayed. I went over the first basic Sinat= ra tutorial but everything appears to be static. Is there any example o= ut there that shows Sinatra dynamically refreshing the page continuo= usly with new information, in my case message queues information?

In other words, once the user successfully get the page disp= layed, from that point on I want the content to be refreshed dynamically wi= th the new information without user intervention.

Thank y= ou

-- Ruby Student




--
Ruby Student
--047d7b67735879bdda04df1d067c--