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: collection_responder.rb
    path of file: ./repos/stackneveroverflow/vendor/bundle/ruby/2.3.0/gems/responders-2.4.0/lib/responders
    
    the code of the file until where you have to start completion: module Responders
  # This responder modifies your current responder to redirect
 
    
    def navigation_location
      return options[:location] if options[:location]
      klass = resources.last.class

      if klass.respond_to?(:model_name)
        resources[0...-1] << klass.model_name.route_key.to_sym
      else
        resources
      end