Hi,
On Apr 18, 2006, at 1:50 PM, parikshit wrote:> Parameters:
{"bestandsliste"=>{"typ"=>"bumffer",
> "KundanName"=>"parikshit",
"Abgeholt"=>"", "LieferLand"=>"",
> "Kaufmann"=>"birla",
"Marge"=>"", "Erzieltervk"=>"",
> "LieferOrt"=>"",
"Hersteller"=>"birla"},
"commit"=>"Verkaufsliste",
>
"verkaufsliste"=>{"vkdatum(1i)"=>"2006",
"vkdatum(2i)"=>"4",
> "vkdatum(3i)"=>"18",
"vkdatum(4i)"=>"17",
"vkdatum(5i)"=>"12"}}
>
> hi every body i want to insert above value but cant able to insert
> date how i can do that.
> plese reply me i juct do this in my controller
> if request.post?
> @verkaufsliste = Verkaufsliste.new(@params[:bestandsliste])
>
> end if @verkaufsliste.save redirect_to :action =>
''list''
> else
> render :action => ''sale''
> end
> end
Try @verkaufsliste = Verkaufsliste.new(params[:bestandsliste])
I collect the information I want to add to the database in a form
like this:
<p><label
for="number_number">Number</label><br/>
<%= text_field ''number'', ''number''
%></p>
<p><label for="number_name">Name</label><br/>
<%= text_field ''number'', ''name''
%></p>
"name" and "number" is the names of the fields in the
database.
def create
@number = Number.new(params[:number])
if @number.save
flash[:notice] = ''Number was successfully created.''
redirect_to :action => ''list''
else
render :action => ''new''
end
end
Hope this helps!
Regards,
Martin Stabenfeldt