<commit_before><div data-role="page">

  <div data-role="header" data-position="inline">
    <h1>Add to Buy List</h1>
    <a href="<%= url_for :action => :index %>" class="ui-btn-left" data-icon="back" data-direction="reverse">
      Cancel
    </a>
  </div>
  
  <div data-role="content">
    <% if @params['known'] == "false" %>
      <h3>No Products Found</h3>
    <% end %>
    <p>Enter the Movie Title and click Add to list. If it is in the database I'll redirect you there.</p>
    <form method="POST" action="<%= url_for :action => :create %>">
      <input type="hidden" name="id" value="<%= @product.object %>"/>
      
          <div data-role="fieldcontain">
            <label for="product[title]" class="fieldLabel">Confirm the Title</label>
            <input type="text" id="product[title]" name="product[title]"
              <% if !@params['title'].blank? %> 
                <%= "value='" + @params['title'] + "'/>" %>
              <% else %>
                <%= placeholder("Title") + "/>" %>
              <% end %> 
          </div>
      <input type="submit" value="Add to List"/>
    </form>
  </div>

</div><commit_msg>Added error checking to Product, fixed header not working.<commit_after><div data-role="page">

  <div data-role="header" data-position="inline">
    <h1>Add to Buy List</h1>
    <!-- 
      In the below a href need to put the location instead of using 
      Ruby url_for code otherwise the button doesn't work. 
    -->
    <a href="/app/Product/index" class="ui-btn-left" data-icon="back" data-direction="reverse">
      Cancel
    </a>
  </div>
  
  <div data-role="content">
    <% if @params['known'] == "false" %>
      <h3>No Products Found</h3>
    <% end %>
    <p>Enter the Movie Title and click Add to list. If it is in the database I'll redirect you there.</p>
    <form id="new_product" method="POST" action="<%= url_for :action => :create %>">
      <input type="hidden" name="id" value="<%= @product.object %>"/>
      <% if @errors %>
        <script type="text/javascript" charset="utf-8">
          $(document).ready(function (){      
            mark_errors("#new_product", <%=  @errors %>);        
          });
        </script>
      <% end %>
      
          <div data-role="fieldcontain">
            <label for="product[title]" class="fieldLabel">Confirm the Title</label>
            <input type="text" id="product[title]" name="product[title]"
              <% if !@params['title'].blank? %> 
                <%= "value='" + @params['title'] + "'/>" %>
              <% else %>
                <%= placeholder("Title") + "/>" %>
              <% end %> 
          </div>
      <input type="submit" value="Add to List"/>
    </form>
  </div>

</div>
{'fraction_non_alphanumeric': 0.19463826661770106, 'fraction_numerical': 0.0033051781123760557, 'mean_word_length': 2.309842041312272, 'pattern_counts': {'":': 0, '<': 74, '<?xml version=': 0, '>': 79, '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': '1733463', 'n_tokens_mistral': 891, 'n_tokens_neox': 821, 'n_words': 208}