Example on implementing HTML5 Server Side Event in Rails 3.2 - ruby-on-rails-3

I am trying to introduce HTML5 Server-Side-Event to my Rails 3.2 project. I did some search at Google.com, but most of the examples are using php. There's only one example on Rails that is using Goliath, and I am not using that.
I am using Thin in my development and deploying with passenger. I think it's valid for doing text streaming for SSE. Is there any examples on Rails 3.2 for reference?

Rails 4.0 is implementing SSE, upgrading your rails and implementing SSE via rails 4.0 ActiveController::Live is probably the best option.
Otherwise you may be stuck with a less stable/performant/maintained option such as Juggernaut or other frameworks.
Source :
http://ngauthier.com/2013/02/rails-4-sse-notify-listen.html
http://edgeguides.rubyonrails.org/4_0_release_notes.html#railties-notable-changes

You can check out 'Cramp' gem - http://cramp.in/
It's having built in support for HTML5 tehcnologies - WebSockets and SSE

This isn't exactly HTML 5 Server Side Events but it is a tried and true method to accomplish essentially the same. To push from the server to the client, in the past a lot of people including myself have used the Juggernaut gem (https://github.com/maccman/juggernaut - runs on top of node.js). A little different than Server Side Events but perhaps more time tested. The gem is still being updated it seems.

Related

Maintain use of non-digested assets url with rails 5

In upgrading to rails 5, some legacy asset urls needed to be converted from from an explicit form like /assets/pretty_image.png to image_url('pretty_image.png'). This a straight forward change and allows proper caching. But there are emails out there with the old form url. Is there anyway I can continue to let urls like /assets/pretty_image.png still work in production?
It turns out this is a problem with upgrading from rails 4, which stopped allowing both digested and non-digested assets being used. For some reason, the problem did not appear in production until I upgraded to rails 5.
There is a good discussion of some possible solutions here. I used the solution entitled 'Use the Manifest, Rake'. I needed to change from pre-compiling on Heroku to precompiling in development to get the solution to work. I am interested in a solution that still allows precompiling on Heroku.

Are there any full-featured tutorials or examples for faye on rails?

I have worked with faye on node before, but now want to add it to a rails app. I've found plenty of quick integration guides and have it up and running, but my current implementation is pretty hacky. I've been unable to find any longer tutorials or examples including a good convention for the server to subscribe to the faye channels, interact with the rails models, and publish responses. Does anyone know of good resources?
The below links can be useful for you,
http://railscasts.com/episodes/260-messaging-with-faye?view=asciicast
First one exhibits the simple instant message application in Rails with the help of faye.
I found the How to Use Faye as a Real-Time Push Server in Rails tutorial to be a good start:
We’re going build a simple chat service. Now, Ryan Bates covered this on Railscast #260, however, we’re going to take a slightly different approach in this tutorial. First, we’ll create a chat service where users enter a public room, and everyone can chat with each other publicly. The second functionality we’ll be adding is private messages. Additionally, we’ll integrate some security to our implementation using Ryan Bate’s private_pub gem.
In about one hour you get a hands-on experience and understanding of Faye, both as a server and as a client. By the end of it you have a very basic chat; and not only that, your chat is also secure via private_pub.
Faye has moved towards rack compatibility, so using a config.ru file and booting with the command rackup is advised (the listen method will not work on the latest version of faye).
Booting Faye with rails isn't encouraged, because FAYE isn't compatible with development middleware in rails, meaning you will always need to run in production mode.
A minimalistic barebones example project was written, which deploys cleanly to heroku as observed live at faye-rails-example.herokuapp.com.

Deploy a Ruby on Rails website

i would like to deploy my ruby on rails website. I am using rails 3.2 and ruby 1.9.3, so have the assets pipeline feature. What i would like to know is who offers the most complete hosting package ( or easiest as I am new to rails). I don't mind paying for a package or trying a free one, just as long as its idiot proof :).
Any advice helpful as I would like to get this uploaded for a client
Heroku is pretty much today's standard for deploying Rails app, if you are into paying for it.
I would personally recommend to deploy in your own server if possible. It's much more versatile and not difficult at all. You could also make the procedure more efficient by using a tool like capistrano, which i highly recommend.

I want to Create A desktop Application with Adobe Air PHP MYSQL

I want to first of all thank everyone for the help I got here in the past. After completing my web application using Html, PHP, jQuery, Javascript, CSS, MYSQL, I realized I don’t want a website. In the end, for security, I prefer knowing who will be accessing my application. Having said that, I want to use most of the work I already did for my website. I understand I can use PHP with AIR and MySQL. I read that many would recommend using SQLite, but my problem is that I will constantly be updating the database. I also read there are some security issues using MYSQL and AIR.
Question 1, if I took the "necessary" security precautions within PHP which connects to MYSQL, would that be ok or is there soething else I should be aware of wit AIR ?
Question 2 if I really need to use SQLite, is there a way to connect to Mysql so that I may update the database.
I'm open to suggestions if there is a third party software that will covert my project to a desktop application with connectivity to MYSQL I also have a third party flash embedded.
Thanks
Make it mandatory to sign in to the website to use it. Will that not be sufficient to know who is accessing your application?
PHP is a server side language. Adobe AIR is desktop application framework. I am not sure that converting a PHP-MySQL application to an Adobe AIR application will be a trivial task.
You can take the distributed application route though by doing the client side in AIR and writing the web services in PHP/MySQL. And if you want a distributed database too, it will get lot more complicated.
You can build a rest api with php and integrate it with adobe air applications via http no need js for this. Just use actionscript with urlloader urlstream.
If you need an offline db you can use sqlite and sync with Mysql via php.
You'll have to forget PHP and use javascript and SQL sintax to do it. You can check this pretty guide from adobe to do so http://help.adobe.com/en_US/air/html/dev/air_htmldevguide.pdf
It won't be easy ;P

Best desktop platform for CRUD on an online Rails web app?

There are so many choices, i need a win/mac application capable of sending info to a rails app, i already have the rails app working on a server, so i just need basic crud activity via xml.
So what should you work this with , Realbasic, Java, Flex?
Thanks in advance.
If you feel like staying in Ruby then you could check out Monkeybars. I haven't done anything serious in it myself but it seems nice, except that the lack of new information on their site is a little discouraging.