DEV Community

Discussion on: More than "Hello World" in Docker: Build Rails + Sidekiq web apps in Docker

Collapse
 
raphael_jambalos profile image
Raphael Jambalos • Edited

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.

class HomeController < ApplicationController
  def index
    @message = "Dynamic"

    @posts = Post.all
  end

  def increment_async
    ::IncrementCountWorker.perform_async(params[:post_id])

    redirect_to root_path # THIS IS THE ADDED LINE
  end
end
Collapse
 
tmhall99 profile image
Tom Hall

Excellent, thanks Raphael!