How to create a record in another table ?


In my Delphi GUI apps, it is common functionality
a) to select a row
b)then 'append to' ie create a row to another table with similar
table structure

I guess the analogy would be to copy a record to another table by
clicking an action link

How can we do it wth ActiveScaffold ?

I think the solution is to copy the record as follows :-

def self.add_transfer_action
    # The copy action
    define_method(:copy) do

    # Override the do_new to implement copy behavior
    define_method(:do_new) do
      if params["action"] == "transfer"
        model = active_scaffold_config.model
        copied_record = model.find(params[:id])

       # how do I specify the target controller ?
        model.columns.each do |column|
            copied_record.send("#{}")) unless

I'm not sure how it will be different for ActiveScaffold as I don't
use it, but to do the actions you described in RoR, you can use
the attributes property:

Assuming that you already have the source row called src,
you can do

target_row =