nikolalsvk / render_async

render_async lets you include pages asynchronously with AJAX
https://rubygems.org/gems/render_async/
MIT License
1.08k stars 75 forks source link

How can I update my view with jquery interval? #67

Closed abidiqbalk closed 5 years ago

abidiqbalk commented 6 years ago

I want to constantly update my partial rendering for showing latest feed after 5 minutes interval. How can I do as using jquery getscript with the specified URL only works in the background and partial on the front side never gets updated?

Thanks

nikolalsvk commented 6 years ago

Hey @abidiqbalk, thanks for opening the issue! Can't think of the quick fix for this, I'd have to expand the codebase to support it.

I'd have to add a code that supports polling of the path you provide. Is it the polling feature you're interested in? It would basically call the path you provided to render_async every N seconds for M times.

abidiqbalk commented 6 years ago

@nikolalsvk exactly this is what I want "call the path you provided to render_async every N seconds for M times"

nikolalsvk commented 6 years ago

Awesome, I'll see to implement this, sounds like an interesting feature that many users can benefit from.

Also, it looks like it's linked to https://github.com/renderedtext/render_async/issues/46

abidiqbalk commented 6 years ago

@nikolalsvk would love to use this feature and give it a 🌟

rafaelgoulart commented 5 years ago

I'd love to see this feature as well!

nikolalsvk commented 5 years ago

Hey y'all,

I've just released this feature in 2.1.0 version

Try it out if you can and let me know how it works :)

ljesus commented 5 years ago

Thanks @nikolalsvk . Is there a way to stop the polling if needed?

nikolalsvk commented 5 years ago

No problem @ljesus. There's no way to stop the polling right now, we should add it definitely!

You can create a new issue with this topic and we could implement it :)