From: "Md. Ruhul Amin" Date: 2007-04-18T12:37:06+09:00 Subject: [ruby-dev:30719] Problem: insert data in two tables from an input form. This is a multi-part message in MIME format. ------=_NextPart_000_0054_01C781B6.46C009D0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit Hi guys, I have two tables. Table1: output_columns (3 columns) Table2: file_datas (2 columns) In any table I can search, show, edit data. But how can I insert data in two table? In my input form there are 5 input fields. I want to input 3 data in table1 and last 2 data in table2. In the OutputColumnsController (the controller of table1) I have written the following code def create @output_column = OutputColumn.new(params[:output_column]) if @output_column.save flash[:notice] = 'OutputColumn was successfully created.' redirect_to :action => 'list' else render :action => 'new' end end By this code I can save in the table1. But how can I handle the input data in table2? Plz help me. Amin----------------------------------- 株式会社 SAO (エス エー オー) E-Mail:amin@e-sao.co.jp URL:www.e-sao.co.jp ----------------------------------- ------=_NextPart_000_0054_01C781B6.46C009D0 Content-Type: text/html; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable
Hi guys,
I have two tables.
Table1: output_columns  (3 columns)
Table2: file_datas      (2 columns)
In any table I can search, show, edit data. But how can I insert data in
two table?
In my input form there are 5 input fields. I want to input 3 data in
table1 and last 2 data in table2. In the OutputColumnsController (the
controller of table1) I have written the following code
def create
    @output_column =3D OutputColumn.new(params[:output_column])
    if @output_column.save
      flash[:notice] =3D 'OutputColumn was successfully created.'
      redirect_to :action =3D> 'list'
    else
      render :action =3D> 'new'
    end
  end
    By this code I can save in the table1. But how can I handle the
input data in table2?
Plz help me.

Amin
-----------------------------------
=1B$B3t<02qE-Mail:amin@e-sao.co.jp
URL:www.e-sao.co.jp
---------------------= --------------
------=_NextPart_000_0054_01C781B6.46C009D0--