I have a page which displays all the products in a shop.
Each time a new product is added - two things happen.
1) The user is taken to the products/index page which shows a list of all the products added - including the new product.
2) A Sidekiq BG job starts. It basically goes to amazon and finds the price of the product added.
As the user is taken the products/index page after they add the product - they see that the new product is added (but the price and other info is empty). I want to somehow update this products/index page dynamically with the details of the new product (which is got via the Sidekiq worker).
I am just thinking how to approach this:
Any help will be appreciated. Just not sure which is the recommended way to do this..
ActionCable works great for this. Once the background job retrieves the data, you can have it send an updated partial over to the user and replace it on the page. I do this for server and app status updates on Hatchbox. Works great.
Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.