Really fix it

This commit is contained in:
benji 2015-10-27 17:11:12 +01:00
parent 9c9511b95e
commit aec212e754
2 changed files with 2 additions and 2 deletions

View file

@ -52,7 +52,7 @@ ready = function() {
barcode = $(this).find("input[type=number]").val();
$("#from_barcode_form")[0].reset();
$.ajax({
url: "/barcodes/" + barcode,
url: $("#from_barcode_form").data("url") + "/barcodes/" + barcode,
success: function(data) {
if (data != null) {
increment_product(data["id"]);

View file

@ -2,7 +2,7 @@
.col-md-6.col-md-offset-1.barcode-wrapper
.center
%h1 Order for #{@user.name}
= form_tag nil, id: "from_barcode_form" do
= form_tag nil, id: "from_barcode_form", data: { url: URI.join(root_url, "barcodes").to_s } do
%input.center-block{ type: :number, name: :id, autofocus: true }
= "- OR -"
%button.btn.btn-default.center-block{ data: { toggle: :modal, target: "#products_modal" } }