Currently I have a system that will successfully add a row to a table.
Each row in this table will represent a new product being added to a
The user can enter a quantity and then select a product code.
The product code is the auto_complete field. This field works.
However, once the user selects a product code then the values for the
product description, buy price, and unit weight should be updated
To try and achieve this I have implemented the following:
@products = Product.find(:all, :conditions => [‘product_code LIKE
‘%’ + params[:product][:product_code] + ‘%’] )
render :partial => ‘podetails_product’
<% for @product in @products do %>
- <%= @ product.product_code %> <% end %>
The log shows the following when attempting to enter a product code:
127.0.0.1 at 2006-01-10 09:19:52) [POST]
e[4;36;1mProduct Load (0.078000)e[0m e[0;1mSELECT * FROM products
(product_code LIKE ‘%5%’) e[0m
e[4;35;1mProduct Columns (0.000000)e[0m e[0mSHOW FIELDS FROM
Rendered purchase_order_detail/_podetails_product (0.12500)
Completed in 0.28100 (3 reqs/sec) | Rendering: 0.12500 (44%) | DB:
0.07800(27%) | 200 OK [
The result after a product code is chosen is nothing.
Nothing happens in the view and nothing happens in the log file.