I can not seem to find a answer to my question anywhere, so please help me if anyone can I am trying to understand this better.
I have a method that passes variables into another model's method to get packlist_id's from a table. such as in my invoices model i have:
def packlistid
Shipperline.packlist(@customerid, @shipqty)
end
The customerid is from another method in my Invoice class (which works amazing) and the shipqty is also from another method query that i did.
Then that method goes into Shipperline model which has a method self.packlist(customerid, shipqty):
def self.packlist(customerid, shipqty)
Shipperline.joins(:customerorderline, :shipper).select("cust_order_id").where(cust_order_id: customerid).pluck(:packlist_id).uniq
end
Then in my view i have:
best_in_place invoice, :packlsitid, :as => :select, :class=>"best_in_place", :collection => invoice.packlistid
This is great cause i get a drop do select box filled with numbers such as
76433
53422
43156
34231
However, when i select one such as the 76433 the value that goes into the database is a 1. Where i want it to be the exact same value 76433.
The 53422 when select puts a value of 2 in the database and so on.
This is rails 4 with best in place version 3.0.1
If anyone can help me i would greatly appreciate it.