Drop down list problem!

I am using a drop down box in a form, the method is GET. The data
that
i am selecting in the box is not getting stored in the database. But
when i am not using the drop down box the rest of the data is getting
stored. I stored the submitted form data in an instance variable.
When
i am trying to print the instance variable no output is coming…
Can anybody tell how to get the selected data in the drop down box in
the other form?

Subhash wrote:

I am using a drop down box in a form, the method is GET. The data
that
i am selecting in the box is not getting stored in the database. But
when i am not using the drop down box the rest of the data is getting
stored. I stored the submitted form data in an instance variable.
When
i am trying to print the instance variable no output is coming…
Can anybody tell how to get the selected data in the drop down box in
the other form?

Can you post some code?

Cheers

On 6 Nov 2007, at 11:58, Rajeev K. wrote:

the other form?

Can you post some code?
ditto. Also, it’s the 4th time you’ve asked this question today. once
is enough.

Fred

This is the code that i have written in the view form:

Service
<%= select_tag 'employee', options_for_select(%w{None ITS RDS Corporate},"None") %>

And the code in the controller is:

  1. New employee creation:

def create
@employee = Employee.new(params[:employee])
if @employee.save
flash[:notice] = ‘Employee was successfully created.’
redirect_to :action => ‘list’
else
render :action => ‘new’
end
end

  1. Updatation:

def update
@employee = Employee.find(params[:id])
if @employee.update_attributes(params[:employee])
flash[:notice] = ‘Employee was successfully updated.’
redirect_to :action => ‘show’, :id => @employee
else
render :action => ‘edit’
end
end

On Nov 6, 4:58 pm, Rajeev K. [email protected]