Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <% content_for :header do -%>
- <%= javascript_include_inputs %>
- <script type="text/javascript">// <![CDATA[
- $(document).ready(function() {
- $("#product_codelinha").change(function() {
- // $("#load").html("<img src="images/layout/interface/spinner.gif" mce_src="images/layout/interface/spinner.gif" alt='carregando...' />");
- show_overlayer();
- $.get('<%= APP_CONFIG["server_adress"] %>products/ajax_load_sublinhas', { linha: $('#product_codelinha').val()}, function(sublinhas){
- $('#sublinhas').empty();
- $('#sublinhas').append(sublinhas);
- hide_overlayer();
- });
- return false;
- });
- });
- // ]]></script>
- <% end -%>
- <div id="form"><% semantic_form_for @product do |form| %>
- <% form.inputs do %>
- <%= form.input :code_product, :label => true, :input_html => {:size => 5, :class => "small"} %>
- <%= form.input :name, :label => true %>
- <%= form.input :codelinha, :as => :select, :collection => @linhas, :label => 'Linha' %>
- <div id="sublinhas"><% if @product.new_record? %>
- <% else %>
- <%= form.input :codesublinha, :as => :select, :collection => @sublinhas, :label => 'SubLinha' %>
- <% end %></div>
- <%= form.input :stock, :label => true, :input_html => { :size => 3, :class => "small" } %>
- <%= form.input :cost_price, :label => true, :mask => :decimal,
- :input_html => {:size => 5, :class => "small"} %>
- <%= form.input :retail_price, :label => true, :mask => :decimal,
- :input_html => {:size => 5, :class => "small"} %>
- <%= form.input :description, :label => true %>
- <%= form.buttons :commit %>
- <% end %>
- <% end %></div>
Add Comment
Please, Sign In to add comment