I grew up in Ann Arbor, Michigan but have been living in Austin, Texas for the better part of the past 10 years. I work as a "DevOps Engineer" and help organize DevOpsDays Austin.
Hi Raphael, thanks for writing this up! I made it all the way to the end but when I click any of the links on the page the number doesn't increment and I get the following message on the server. However when I reload the page the number does appear to be incremented.
web_1 | Started POST "/increment_async?post_id=3" for 172.19.0.1 at 2019-11-14 16:13:27 +0000
web_1 | Cannot render console from 172.19.0.1! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
web_1 | Processing by HomeController#increment_async as HTML
web_1 | Parameters: {"authenticity_token"=>"nJyVPYC66u05NEifhJpSU8j45OihvALWatPZded9kBbveo8I463AVM9+XjHiOABKtnh9FvjxAfOkcbdC1oEhiA==", "post_id"=>"3"}
sidekiq_1 | 2019-11-14T16:13:27.719Z pid=1 tid=gs60ykwsh class=IncrementCountWorker jid=ff410d219f7e7968abf5a765 INFO: start
sidekiq_1 | 2019-11-14T16:13:28.145Z pid=1 tid=gs60ykwsh class=IncrementCountWorker jid=ff410d219f7e7968abf5a765 elapsed=0.424 INFO: done
web_1 | No template found for HomeController#increment_async, rendering head :no_content
web_1 | Completed 204 No Content in 1241ms (ActiveRecord: 0.0ms)
Thank you for reading through the article, and providing me with this feedback. I have update the article with the answer to your question. I also included the answer below for easier reference
In step 7.5, copy-paste this snippet instead. This adds the line redirect_to root_path in the controller function increment_async so it goes to the homepage once the link is pressed.
classHomeController<ApplicationControllerdefindex@message="Dynamic"@posts=Post.allenddefincrement_async::IncrementCountWorker.perform_async(params[:post_id])redirect_toroot_path# THIS IS THE ADDED LINEendend
I grew up in Ann Arbor, Michigan but have been living in Austin, Texas for the better part of the past 10 years. I work as a "DevOps Engineer" and help organize DevOpsDays Austin.
Hi Raphael, thanks for writing this up! I made it all the way to the end but when I click any of the links on the page the number doesn't increment and I get the following message on the server. However when I reload the page the number does appear to be incremented.
web_1 | Started POST "/increment_async?post_id=3" for 172.19.0.1 at 2019-11-14 16:13:27 +0000
web_1 | Cannot render console from 172.19.0.1! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
web_1 | Processing by HomeController#increment_async as HTML
web_1 | Parameters: {"authenticity_token"=>"nJyVPYC66u05NEifhJpSU8j45OihvALWatPZded9kBbveo8I463AVM9+XjHiOABKtnh9FvjxAfOkcbdC1oEhiA==", "post_id"=>"3"}
sidekiq_1 | 2019-11-14T16:13:27.719Z pid=1 tid=gs60ykwsh class=IncrementCountWorker jid=ff410d219f7e7968abf5a765 INFO: start
sidekiq_1 | 2019-11-14T16:13:28.145Z pid=1 tid=gs60ykwsh class=IncrementCountWorker jid=ff410d219f7e7968abf5a765 elapsed=0.424 INFO: done
web_1 | No template found for HomeController#increment_async, rendering head :no_content
web_1 | Completed 204 No Content in 1241ms (ActiveRecord: 0.0ms)
Hi Tom,
Thank you for reading through the article, and providing me with this feedback. I have update the article with the answer to your question. I also included the answer below for easier reference
In step 7.5, copy-paste this snippet instead. This adds the line
redirect_to root_path
in the controller function increment_async so it goes to the homepage once the link is pressed.Excellent, thanks Raphael!