Saturday, 15 January 2011

Rails form remove has many relationship -


How much relationship can I remove through the input tag in the rail?

I have a model named invoice. I'm trying to delete all the associated models for the invoice:

   

Input Name = "Invoice [expense_ids] []" value = ""

But it does not seem to work. In the correct action for update_attributes function in the input format for the parameter What is the correct way?

How do I do this in the controller

  Invoice. Expense_Idays = [] If invoice.Serstist? Invoice .update_attributes (params [: invoice])   

that will remove any exposure association before updating the record by default, so existing ones will be added back or any If it does not pass it will be empty

  id = invoice. Expense_yends id = id.k_ip_i {i}   

| Parameters [: Invoice] [: expense_ids] .include? (I)} invoice Expans_iids = id

No comments:

Post a Comment