<commit_before>	<% if logged_in? %>
		<%= link_to 'Sign Out', logout_path %>
	<% else %>
		<%= link_to 'Sign Up', new_user_path %>
		<%= link_to 'Sign In', new_session_path %>
	<% end %>

	<div class='main_search'>
		<div><%= image_tag "Pigly-logo.png", :class => "main_logo" %></div>
		</br>
		<%= form_for @restaurant, url: search_restaurants_path do |restaurant_form| %>
			<%= restaurant_form.text_field :name, :placeholder => "Search For A Restaurant..." %>
		<% end %>
	</div>


<script>
  $(function() {
   	var restaurant_names = <%= raw @names %>;
   	var searchBox = $('#restaurant_name');
    searchBox.autocomplete({
      source: restaurant_names,

      select: function(e, ui) {
        $(e.target).parents("form").submit();
      }
    });
  });
 </script><commit_msg>On click, autocomplete submitted only what had been typed in. Fixed this issue.<commit_after>	<% if logged_in? %>
		<%= link_to 'Sign Out', logout_path %>
	<% else %>
		<%= link_to 'Sign Up', new_user_path %>
		<%= link_to 'Sign In', new_session_path %>
	<% end %>

	<div class='main_search'>
		<div><%= image_tag "Pigly-logo.png", :class => "main_logo" %></div>
		</br>
		<%= form_for @restaurant, url: search_restaurants_path do |restaurant_form| %>
			<%= restaurant_form.text_field :name, :placeholder => "Search For A Restaurant..." %>
		<% end %>
	</div>


<script>
  $(function() {
   	var restaurant_names = <%= raw @names %>;
   	var searchBox = $('#restaurant_name');
    searchBox.autocomplete({
      source: restaurant_names,

      select: function(e, ui) {
      	$(e.target).val(event.target.innerHTML);
        $(e.target).parents("form").submit();
      }
    });
  });
 </script>
{'fraction_non_alphanumeric': 0.19441141498216408, 'fraction_numerical': 0.0, 'mean_word_length': 3.536388140161725, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 43, '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': '4913583', 'n_tokens_mistral': 657, 'n_tokens_neox': 578, 'n_words': 128}