diff --git a/app/views/issue_resource_items/create.js.erb b/app/views/issue_resource_items/create.js.erb index f3dad28..35881e2 100644 --- a/app/views/issue_resource_items/create.js.erb +++ b/app/views/issue_resource_items/create.js.erb @@ -1,7 +1,7 @@ var wrapper = $('#<%= @issue_resource_items.first.resource_item.class.name.underscore %>_resource_item_list'); <% @issue_resource_items.each do |item| %> var i = $('#<%= j dom_id item.resource_item %>'); - if(i.size() == 0){ + if(i.length == 0){ wrapper.append('<%= j issue_resource_item_form_tag item %>'); } <% end %> diff --git a/app/views/issue_supply_items/create.js.erb b/app/views/issue_supply_items/create.js.erb index cb904b9..383a689 100644 --- a/app/views/issue_supply_items/create.js.erb +++ b/app/views/issue_supply_items/create.js.erb @@ -1,6 +1,6 @@ <% @issue_supply_items.each do |i| %> var wrap = $("#issue-form #<%= dom_id i.supply_item %>_wrap"); - if (wrap.size() > 0) { + if (wrap.length > 0) { var quantity = wrap.find('input').val(); if (quantity) { quantity = parseFloat(quantity);