[Rails] How to assign currently logged in user name to a table field

2010-03-31 Thread Railsquestion Zz
I have 3 tables items (columns are: id, name , type) history(columns are: id, date, username, item_id, user_id) user(id , username, password) When a user "ABC" logs in and creates a new item, a history record gets created with the following after_create filter. How to set the username field in

[Rails] Adding items in groups in Rails

2010-03-22 Thread Railsquestion Zz
My product table is idtype price location 1 chips $3 aisle3 I have a question with adding the products in groups. There is a quantity field(nonmodel) where the user can enter the quantity While adding a new product if the user enters: type: soda quant