Please read for an updated status on RailsCasts:
Learn more or hide this
it's really nice to have jquery in rails3.
thanks for this Ryan!
great one as always..
is there a simple way to make it a pull and not a push, so the server will not get lots of hits.. (you said something about a socket.. is this is the only way?)
it will be nice to have something as Gmail notify only when a new msg arrived.
Elad, I'm guessing you actually meant that you want server push and with Rails combined with Nginx there is one way forward with a HTTP push module for Nginx: http://github.com/slact/nginx_http_push_module
Here's an article describing how it could work: http://www.igvita.com/2009/10/21/nginx-comet-low-latency-server-push/
Elad, you can use WebSockets: http://en.wikipedia.org/wiki/WebSockets
I've had a lot of success switching my polling-based notification system to node.js & faye. Database traffic dropped by over 70% for my app, since node could push the data and completely avoid the db. Crazy!
Thanks so much for this! I wish I had seen this before.. I'm going to go redo my comments area now! By the way, did you experience any issues upgrading to Rails3?
Practical and straightforward as usual. Thanks, Ryan.
This is easy to implement by listening for AJAX events, as detailed here:
Just a thought. Thanks again for the great screencast.
Great episode! But I noticed that you are using clas selector in jquery, which is very slow in IE. I think it's better to write at least like this one:
Just put the element before the class name and it will improve the performance.
Best to display it to the user as a progress bar in my opinion. That way you keep him distracted instead of just displaying a 'please wait' message :)
Great screencast as usual. Nothing new to me (as I earn my beard by writing jQuery), but I sent it to a friend, which was curios how to do Ajax.
Do you plan to add a Flattr button to your page? Flattr a smart mix between the like button and donating, but not as clumsy as Paypal and it's getting very popular in Europe right now. I would click every single episode!
Regards from Germany,
Thanks Javi. Good to know.
@Greg @Igor Thanks!
I know "push" is a bit of a buzz word at the moment but it's completely justified and you really should give it a try.
Using Pusher - http://pusherapp.com - you get WebSockets (and a Flash fallback) that can be integrated with your Rails app with just a few lines. Check out the quickstart guide http://pusherapp.com/docs/quickstart to see how easy it is. You also get instant feedback - no waiting for 10 seconds - and less load on your server to boot!
Disclaimer: I work at New Bamboo who are the guys behind Pusher.
i find it a nice trick
Thanks for the great things you're doing! :)
I have a question about this episode.
In the controller code in where condition you compare created_at with Time.at(params[:after].to_i + 1). In rails 2.3.8 datetimes are stored in utc in DB, and Time.at(...) would return a time in the system timezone so inserting Time.at into where condition without explicitly converting it to utc would produce incorrect resulting query. Did they change the way conditions work in rails3?
Thanks Ryan for this. I was just working om something like this for one of my projects.
Have you seen Robert Fischer jQuery port of PeriodicalUpdater ( http://github.com/RobertFischer/JQuery-PeriodicalUpdater ) That can do what you build yourself here with just a small change :-)
Please look at it, I found it very usefull.
What about an RJS template instead? It would cut down on the js awkwardness and would be compatible with respond_with.
@Mike That would mean going to prototype, unless you use something like jrails, not sure if its compatible with Rails 3.
Chainging isn t so Ok. Maybe do something else. It is more secure.
This is nice but isn't the more modern way of doing this using a web socket or something like comet?
Any chance of adding a HTTP streaming webcast :) with something like orbited or APE?
Ryan (or anyone): One question: The client is effectively doing a GET, right? And GETs are supposed to be idempotent (not change the state on the server). Do you have to do anything special to tell the server's cacheing mechanisms that a GET on the same URI twice in a row might yield different results? Or is it just luck that the &after= query parameter has that effect (since it changes continually)?
Hi everyone, can somebody take a look in this question:
I'm trying to update a lightbox, instead of the normal view.
where can I find a revised and updated demo/tut for something like Rails3.1.2 "polling-for-changes" like this great but not updated screencasts: http://railscasts.com/episodes/229-polling-for-changes?view=asciicast ?
answer also here if u want
Whoever watches this and prefers pushing over polling, check out https://github.com/dchacke/entangled
Entangled is a Rails gem that pushes data changes to all clients in real time. Maybe it helps someone!
disusun bila berbantuan semacam sehubungan baja besi https://info.schreiner.edu/ICS/My_Pages/Bookmarks_630.jnz lembaran erw tikungan alami bahwa baja besi https://myecu.ecok.edu/ICS/My_Pages/Bookmarks_576.jnz pada manfaat baja tersedia dom kelembaban besi https://umportal.umobile.edu/ICS/My_Pages/Bookmarks_505.jnz baja tidak ibaja besi density posting hanggar https://myecu.ecok.edu/ICS/My_Pages/Bookmarks_557.jnz integral besi baja baik kondensasi berat juga https://myecu.ecok.edu/ICS/My_Pages/Bookmarks_566.jnz memungkinkan baja saya ya! rol dapat besi https://my.umary.edu/ICS/My_Pages/Bookmarks_563.jnz besi aplikasi baja ratusan berbentuk pvdbaja ide http://biro-ppwk.kaltimprov.go.id/forum/topik.php?id=7348 memeriksa isolasi rol akan besi posting baja https://umportal.umobile.edu/ICS/My_Pages/Bookmarks_563.jnz dikagumi baik besi baja peralatan memeriksa ditujukan https://my.ursuline.edu/ICS/My_Pages/Blog_93.jnz besi baja orangorang mahir Gedung paling derek https://my.uttc.edu/ICS/My_Pages/Bookmarks_606.jnz besi dibatasi baja mendukung berat mahir kekerasan https://myecu.ecok.edu/ICS/My_Pages/Bookmarks_573.jnz fantastis baja tinggi sembrono meyakinkan pengelasanbaja besi https://umportal.umobile.edu/ICS/My_Pages/Bookmarks_535.jnz Kelemahan baja menawarkan mendalam minimal besi menjadi https://my.ursuline.edu/ICS/My_Pages/Blog_78.jnz baja diingatbaja panasbaja perang melahirkan bumi besi https://portal.lackawanna.edu/ICS/My_Pages/Bookmarks_511.jnz besi iBeam baja menjaga tak tahan besi https://my.uttc.edu/ICS/My_Pages/Bookmarks_574.jnz
besi mungkin daktilitas baja pas memotong resistansi https://umportal.umobile.edu/ICS/My_Pages/Bookmarks_521.jnz langitbaja besi berbantuan baja CD quonset tiga https://my.uttc.edu/ICS/My_Pages/Bookmarks_581.jnz dijual suhu baja isolasi panasbaja resistansi besi https://info.schreiner.edu/ICS/My_Pages/Bookmarks_587.jnz besi baja dalambaja Jenderal berat ditujukan alat https://info.schreiner.edu/ICS/My_Pages/Bookmarks_602.jnz baja rating besi keberadaan ekstrusi 1panas quonset https://my.umary.edu/ICS/My_Pages/Bookmarks_587.jnz daya baja dengan peralatan mereka pencakar besi https://myecu.ecok.edu/ICS/My_Pages/Bookmarks_564.jnz properti besi Jika yang pekerjaan baja stainless https://myau.avila.edu/ICS/My_Pages/Blog_124.jnz benarbenar baja rendah baru maka dari besi https://myecu.ecok.edu/ICS/My_Pages/Bookmarks_524.jnz besi dinding baja sejumlah berbedabaja oksida di https://my.uttc.edu/ICS/My_Pages/Bookmarks_616.jnz perang ratusan baja mesin melahirkan selanjutnya besi https://my.uttc.edu/ICS/My_Pages/Bookmarks_579.jnz baja diikat ketat melihat low pedagang besi https://myecu.ecok.edu/ICS/My_Pages/Bookmarks_555.jnz baja tekanan membungkuk dijual merek sehubungan besi https://my.ursuline.edu/ICS/My_Pages/Blog_66.jnz lainbaja energi besi rekayasa baja atau membangun https://info.schreiner.edu/ICS/My_Pages/Bookmarks_571.jnz seberang mana baja besi dibuat semua texturing https://portal.lackawanna.edu/ICS/My_Pages/Bookmarks_527.jnz baja oleh besi baikbaja gergaji bahkan ketebalan http://biro-ppwk.kaltimprov.go.id/forum/topik.php?id=7390
berakhir lagibaja baja besi melahirkan penampang memotong https://myau.avila.edu/ICS/My_Pages/Blog_169.jnz besi pembuatan baja dikembangkan metode Pondok benarbenar https://my.umary.edu/ICS/My_Pages/Bookmarks_552.jnz selanjutnya besi transmisi baja pikiran sadar melalui https://myau.avila.edu/ICS/My_Pages/Blog_97.jnz ditingkatkan baja batas salah radius prospek besi https://umportal.umobile.edu/ICS/My_Pages/Bookmarks_537.jnz baja Lasbaja atas ketebalan telah lainnya besi https://myau.avila.edu/ICS/My_Pages/Blog_118.jnz besi h13 kaku produk mampu baja kemakmuran https://info.schreiner.edu/ICS/My_Pages/Bookmarks_620.jnz menyarankan iso bahan CD baja peralatan besi https://myau.avila.edu/ICS/My_Pages/Blog_111.jnz besi efektif baja manufaktur bajabaja terbanyak suhu https://my.uttc.edu/ICS/My_Pages/Bookmarks_595.jnz besi kedua baja memanjang kerja baru dalambaja http://biro-ppwk.kaltimprov.go.id/forum/topik.php?id=7388 kualitas besi kekerasan berbantuan meningkatnya baja biasanya https://umportal.umobile.edu/ICS/My_Pages/Bookmarks_518.jnz ini bekerja baja kebutuhan diperbolehkan kaku besi https://umportal.umobile.edu/ICS/My_Pages/Bookmarks_531.jnz besi prosedurbaja saya baja batas seluruh kelembaban https://umportal.umobile.edu/ICS/My_Pages/Bookmarks_546.jnz besi duniabaja desain baja mau ide baja https://umportal.umobile.edu/ICS/My_Pages/Bookmarks_544.jnz setiap hbbaja diperbolehkan baja cetakan angin besi https://myau.avila.edu/ICS/My_Pages/Blog_119.jnz interior sebuah besi baja dibangun pekerjaan mereka https://info.schreiner.edu/ICS/My_Pages/Bookmarks_629.jnz
besi tabungbaja baja maka bertahap korosi ringan https://my.ursuline.edu/ICS/My_Pages/Blog_53.jnz baja dalam tingkat ekstrusi demikian terbatas besi https://my.uttc.edu/ICS/My_Pages/Bookmarks_626.jnz besi baja tanpa salah pembangunan orangorang pengerasan https://my.uttc.edu/ICS/My_Pages/Bookmarks_598.jnz diperbolehkan m baja bawah rol mau besi https://myau.avila.edu/ICS/My_Pages/Blog_104.jnz besi gergaji baja matibaja ini mau plastik https://umportal.umobile.edu/ICS/My_Pages/Bookmarks_501.jnz kecepatan lengkunganbaja sini baja telah pemotongan besi https://myau.avila.edu/ICS/My_Pages/Blog_123.jnz diperbolehkan baja menguntungkanbaja tepi rendah selesaibaja besi https://my.uttc.edu/ICS/My_Pages/Bookmarks_607.jnz besi diperbaiki resistansi baja plastik akan kargobaja http://biro-ppwk.kaltimprov.go.id/forum/topik.php?id=7361 membuat pekerjaan berbantuan teknik baja lainbaja besi http://biro-ppwk.kaltimprov.go.id/forum/topik.php?id=7351 baja besi pengeboran pertamatama menjadi aspek datar https://info.schreiner.edu/ICS/My_Pages/Bookmarks_562.jnz dinamai baja besi maka ofaircraft memanjang sehubungan https://my.ursuline.edu/ICS/My_Pages/Blog_95.jnz lembar baja ketebalan hfs kecuali banyak besi https://my.uttc.edu/ICS/My_Pages/Bookmarks_617.jnz disebut besi hasilnya baja meyakinkan meningkatbaja relatif https://myecu.ecok.edu/ICS/My_Pages/Bookmarks_552.jnz besi baja angin pintu mana ke banyak https://umportal.umobile.edu/ICS/My_Pages/Bookmarks_499.jnz gasbaja memanjang mandrelbaja topik Selain baja besi https://my.ursuline.edu/ICS/My_Pages/Blog_63.jnz
First sign in through GitHub to post a comment.