How to position a drop lower for that virtual column, within the ruby on rails. The virutal column doesn't appear in my table , but I wish to obtain the value in the drop lower ,when user saves the information.

for instance,

product_cost is really a virtual column , which does not appear in my database table. But I must possess a dropdown, with product cost to become displayed from another table. So when user chooses the merchandise_cost, the chosen product_cost ought to be gettable within an object as self.product_cost.

Virtual column for labels is working fine, however for drop lower it is not employed by me..any info woud be Grateful...

class Product
  belongs_to :product_price
end
class ProductPrice
  #assume a field called "price"
  has_many :products
end

<% form_for @product do |f| -%>
    <%= f.select("product_price_id", ProdcuctPrice.all.collect {|p| [ p.price, p.id ] })
<% end -%>