JS not recognized in link_to_remote respond_to?

In my view I have this test...

<%= link_to_remote('AJAX Alert', :url => '/sandbox/submit', :success => 'alert(request.responseText)') %>

In my controller, this works and outputs "AJAX Response"...

def submit render :layout => false end

But if I add the respond_to block, the format.js never gets recognized...

def submit respond_to do |format| format.js { render :layout => false } format.any(:html, :mobi, :touch) { # render normal layout } end end

I am a bit outside my comfort zone here, but should that be :url => '/sandbox/submit.js' above if you want to specify format.js in respond_to

Colin

Shit, this is exactly the same problem but it went unsolved...

RJS seems to be a problem when setting up iphone mime-types...

Mime::Type.register_alias "text/html", :iphone

Got it!

headers["Content-Type"] = "text/javascript" render :action => 'submit.js.rjs'

Whew.