<commit_before>class PreviewController < ApplicationController
  def create
    @preferences = UserPreferences.new( params )
    @query_command = QueryCommand.new( @preferences )
    @query_command.load_query_results()

    if request.xhr?
      preview_header = render_to_string( partial: "hpi/selected_location", layout: false )
      results_preview = render_to_string( partial: "preview", layout: false )
      render json: {header: preview_header, preview: results_preview}
    end
  end
end<commit_msg>Bug fix: lookup confirmation action not working in non-JavaScript version<commit_after>class PreviewController < ApplicationController
  def create
    @preferences = UserPreferences.new( params )
    @query_command = QueryCommand.new( @preferences )
    @query_command.load_query_results()

    if request.xhr?
      preview_header = render_to_string( partial: "hpi/selected_location", layout: false )
      results_preview = render_to_string( partial: "preview", layout: false )
      render json: {header: preview_header, preview: results_preview}
    end
  end

  # This action is performed when the user clicks a search result link in non-Javascript mode
  def index
    create
    render action: :create
  end

end
{'fraction_non_alphanumeric': 0.07654723127035831, 'fraction_numerical': 0.0, 'mean_word_length': 4.274678111587983, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4537919', 'n_tokens_mistral': 343, 'n_tokens_neox': 335, 'n_words': 100}