murfhy
March 18, 2010, 6:30am
1
my question is i have a drop down list to choose some vales from
an xml file.after selecting one vaale and saving it will b saved.
but when i tried to edit that it should be disabled. can any one
provide solutions
this is ma code fragment
= f.select :name_type, Setting.unroll(:name_type), { :selected
=> (@name.name_type || “mathew”).to_sym }, { :style =>
“width:300px”,:disabled => “true” }
here name_type is the name of variable declared in d xml file with
that names.so what should b code 4 disabled
murfhy
March 18, 2010, 12:52pm
2
On 18 March 2010 05:30, Tony A. [email protected] wrote:
here name_type is the name of variable declared in d xml file with
that names.so what should b code 4 disabled
Assuming there are separate views for new and edit then just disable
it in the edit view.
Colin
murfhy
March 18, 2010, 1:21pm
4
On 18 March 2010 12:04, Tony A. [email protected] wrote:
no  one  view  for  both
If you are using the same view for both how does the view know whether
to submit a create or an update action?
Colin
murfhy
March 18, 2010, 2:11pm
5
this is ma code fragment
= f.select :name_type, Setting.unroll(:name_type), { :selected
=> (@name.name_type || “mathew”).to_sym }, { :style =>
“width:300px”,:disabled => “true” }
here name_type is the name of variable declared in d xml file with
that names.so what should b code 4 disabled
Try:
= f.select :name_type, Setting.unroll(:name_type), { :selected
=> (@name.name_type || “mathew”).to_sym }, { :style =>
“width:300px”,:disabled => !@name.new_record ? }
Cheers,
Andy
murfhy
March 19, 2010, 6:27am
6
great sir.its working now.any way thnks. too got a logic butt
not workn under some specific conditions. this code beats all of
those
Andy J. wrote:
this is ma code fragment
= f.select :name_type, Setting.unroll(:name_type), { :selected
=> (@name.name_type || “mathew”).to_sym }, { :style =>
“width:300px”,:disabled => “true” }
here name_type is the name of variable declared in d xml file with
that names.so what should b code 4 disabled
Try:
= f.select :name_type, Setting.unroll(:name_type), { :selected
=> (@name.name_type || “mathew”).to_sym }, { :style =>
“width:300px”,:disabled => !@name.new_record ? }
Cheers,
Andy