Sha256: 64a4a60459a4c3fd205ffd50fd2e96e39c782eea52dfa93e8192286c136ec630

Contents?: true

Size: 1.45 KB

Versions: 1

Compression:

Stored size: 1.45 KB

Contents

<%= form_for(@order) do |f| %>
  <% if @order.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@order.errors.count, "error") %> prohibited this order from being saved:</h2>

      <ul>
      <% @order.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <%= text_field_tag :notes %>
  <br>
  <%= text_field_tag :client %>

  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>

<br><br>
<h2>Simple form:</h2>
<%= simple_form_for(@order) do |f| %>
  <% if @order.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@order.errors.count, "error") %> prohibited this order from being saved:</h2>

      <ul>
      <% @order.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <%= f.input :notes  %>
  <br>

  <%#= f.input :client, :as => :autocomplete, :source_query => autocomplete_client_name_orders_url, :items => 2, :minLength=>1, :afterSelect=>'after_select_client' %>
  <%#= f.input :client, :as => :autocomplete, :source_query => autocomplete_client_name_clients_url %>
  <%= f.input :client, :as => :autocomplete, :source_query => autocomplete_client_name_clients_url, :field_id=>false %>


  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>



<script>
  function after_select_client(item){
    console.log('item is selected');
    console.log(item);

  }
</script>


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bootstrap_autocomplete_input-0.2.0 test/dummy/app/views/orders/_form.html.erb