You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: posting_controller.rb
    path of file: ./repos/sugar/app/controllers/concerns
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module PostingController
  extend ActiveSupport::Concern

  private


    
  def respond_with_updated_post(post, redirect_url)
    respond_to do |format|
      if post.valid?
        format.html { redirect_to redirect_url }
        format.json { render json: post }
      else
        format.html { render action: :edit }
        format.json { render json: post, status: :unprocessable_entity }
      end
    end