Forum: Ruby on Rails can we take two argument in params

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
parikshit (Guest)
on 2006-04-17 17:29
(Received via mailing list)
hi everybody
 i made two tables 1)bestandslistes and 2)verkaufslistes

i have one form given below*****
Hersteller


Kaufmann



Typ



 KundenName







  'customer'  %>


VK Datum


now in controller i made this code for insert a value in verkaufslistes
table*****

@verkaufslistes = Verkaufsliste.new(params[:bestandsliste])
if @verkaufslistes.save
   redirect_to :action => 'list'
else
    render :action => 'sale'
end
but the value of vkdatum field is not submitted.
so pleses help me
Adam B. (Guest)
on 2006-04-18 21:21
Sorry if I have misinterpreted you in any way. I don't speak German so
I'm not entirely sure how your system is structured, but I will do my
best.

Your form view should have a line something like this for each field:

<%= text_area 'bestandslistes', 'Hersteller' %>

that tag "bestandslistes" is what indicates a field that will be
included in params[:bestandslistes]. So if, for example, the field for
"VK Datum" looks like this:

<%= text_area 'verkaufslistes', 'VK Datum' %>

It will create a new params field called by 'params[:verkaufslistes]'.
If you want it to be included in params[:bestandslistes] you should
change

<%= text_area 'verkaufslistes', 'VK Datum' %>

to

<%= text_area 'bestandslistes', 'VK Datum' %>

Hopefully this helped. There's a more thorough description in the API
docs:

http://api.rubyonrails.org/classes/ActionView/Help...

If you have any difficulty, please post your complete form code and your
verkaufslistes table so I can help you better.

-Adam
This topic is locked and can not be replied to.