Format.js in IE6

Hi
I have the code

@service_desk_resolution=ServiceDeskResolution.find @sd_resolution_id
@sd_resolv=ServiceDeskResolutionEffort.new
@ret_val=@sd_resolv.checkdata(@sd_effort)
error_value=0
respond_to do |format|
@error_message=’’
@ret_val.each do |val|
if val==‘nonnumeric’
@error_message=@error_message+’
’+‘Please enter the numeric
value for effort.’+’

error_value=1
end
end
if @sd_ticket.service_desk_cis.empty?
@error_message=@error_message+’
’+‘No associated
CIs.’+’

error_value=1
end
if error_value==1
format.js do
#here get IE6 problem
puts ‘in format.js’
render :action => ‘sd_resolution_range_nonnumeric_ci_check.rjs’
end
format.html do
puts ‘in error else part format.html’
flash[:notice]=@error_message
redirect_to :action => ‘define_sd_resolution_ui’,:id =>
params[:id]
end

  And I am calling the same from both ajax and normal way(ie link_to

and link_to_remote)…It is working properly in Firefox…But when I
checked in IE6 what happens is if the clicked link is link_to then also
it ennters to format.js instaed of format.html And I can’t figure out
why this happens in IE6.Please help

Thanks in advance
Sijo

Hi
I could solve the problem by just rearranged format.html first and
then format.js… But still my doubt remains. Was that created the
problem ?Is it a must to write format.html first?

Sijo

On Tue, Sep 23, 2008 at 6:13 AM, Sijo Kg
[email protected]wrote:

I could solve the problem by just rearranged format.html first and
then format.js… But still my doubt remains. Was that created the
problem ?Is it a must to write format.html first?

Yes, format.html must be first. The reason is that Rails uses the HTTP
“Accepts” header to determine the content type that the browser is
asking
for. Along with reasonable things like “text/html”, IE6 includes “/”,
telling Rails that it will take anything. Rails will server up the
first
response format that matches, so it’ll give the first one.

Gross, isn’t it? Imagine the day when we won’t have to worry about IE6.
seeing visions of sitting in a hammock on the ocean

Brandon

Sessions by Collective Idea: Ruby on Rails training in a vacation
setting
http://sessions.collectiveidea.com