you can force the used formats:
respond_to do |format|
format.js { render :layout => "notice", :formats => [:html] }
format.html { render :layout => "notice" }
end
EDIT:
What you need is part of the document replaced by the answer. This is done using javascript that does the job:
In your controller:
respond_to do |format|
format.js
format.html { render :layout => "notice" }
end
In your view login.js:
$('#whatever').html('<%= escape_javascript( render :login, formats: [ :html ]) %>')
... or something similar