Forum: Ruby Need to move multiple fields to a new table - please help!

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
21310a1cd3c6888975ef2a8795bbc518?d=identicon&s=25 Tony M. (Guest)
on 2007-04-25 16:12
Okay I have a "list" view that contains a package inventory stored in a
table called addpackages.   Attributes include fname, lname,
packagetype, email, phone, etc.

Here's what I've done already:
1. When you click the last name of a person in the list view simulating
they are picking the package up, you go to my custom edit view.
 <td><%= link_to addpackage.lname, :action => "edit", :id => %></td>

2. Here is my custom edit view:
<form action="../update/<%= %>" method="POST"">
 <input id="addpackage_id" name="addpackage[id]" size="30"
 type="hidden" value="<%= %>" />

 <p><b>User must enter initials to claim package:</b><br>

  <input id="addpackage_signature" name="addpackage[signature]" size="5"
 type="text" value="<%= @addpackage_signature %>" />

 <input type="submit" value="Sign for package" />

3. This all works fine for getting the signature in the addpackages
table.   What I would like to do at this point is copy a few
attributes(lname, fname, signature, phone) to a table called receipts?
I've already created a relationship between addpackages and receipts, I
just need help with coding behind this operation.  I figure I would
perform this operation in the addpackage controller under "def edit" but
I really need a kick start to coding this or someone to tell me this is
the correct way to do it.

Help will be greatly greatly appreciated!!!

Ac0085dae0703db56ad7f8cb9e1798ba?d=identicon&s=25 Phillip Gawlowski (Guest)
on 2007-04-25 16:26
(Received via mailing list)
Tony M. wrote:
[snip Rails questions]

> Help will be greatly greatly appreciated!!!

The Rails folks can help you better, I guess:

Phillip "CynicalRyan" Gawlowski

Rule of Open-Source Programming #34:

Every successful project will eventually spawn a sub-project
This topic is locked and can not be replied to.