khongtac07
New Member
I am using a rails form helper for a dropdown list as follows :\[code\]<%= select_tag :analysis, options_for_select(%w[PENDING PASS FAIL], row3[7]), :disabled=> "true", :id => 'build_status#{index}', :style=> 'width:100px', nchange => 'this.form.submit()'%> \[/code\]Now instead of having \[code\]:disabled=> "true",\[/code\]I want to use a ruby variable such that \[code\]$tmp = "disabled"\[/code\]And use this variable to make the dropdown list disabled. Because sometimes I want to keep it enabled and sometimes it will be disabled based on the value of the $tmp variable.I am having trouble with the syntax. Can anyone test it out and see which syntax works properly?