format.js in IE6

    I have the code

@service_desk_resolution=ServiceDeskResolution.find @sd_resolution_id
  respond_to do |format|
     @ret_val.each do |val|
       if val=='nonnumeric'
         @error_message=@error_message+'<br>'+'Please enter the numeric
value for effort.'+'<br>'
             if @sd_ticket.service_desk_cis.empty?
         @error_message=@error_message+'<br>'+'No associated
     if error_value==1
       format.js do
                #here get IE6 problem
         puts 'in format.js'
         render :action => 'sd_resolution_range_nonnumeric_ci_check.rjs'
       format.html do
           puts 'in error else part format.html'
           redirect_to :action => 'define_sd_resolution_ui',:id =>

      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

    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