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

Discussion in 'Ruby' started by Tony M., Apr 25, 2007.

  1. Tony M.

    Tony M. Guest

    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 =>
    addpackage.id %></td>


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

    <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 %>" />
    </p>

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


    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!!!

    -Tony

    --
    Posted via http://www.ruby-forum.com/.
     
    Tony M., Apr 25, 2007
    #1
    1. Advertising

  2. Phillip Gawlowski, Apr 25, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KK
    Replies:
    2
    Views:
    648
    Big Brian
    Oct 14, 2003
  2. Cyril.Liu
    Replies:
    0
    Views:
    459
    Cyril.Liu
    Dec 2, 2008
  3. Eduardo78
    Replies:
    0
    Views:
    265
    Eduardo78
    Nov 3, 2005
  4. Andrew Tomazos
    Replies:
    2
    Views:
    649
    Nobody
    Dec 12, 2011
  5. Replies:
    0
    Views:
    301
Loading...

Share This Page