Possible Duplicate:
Weird “406 not acceptable” error
I receive a "406 Not acceptable" error after doing a respond_to with a format.js. This is the link:
<%= link_to I18n.t(:alert_dismiss), :controller => 'alerts', :action => 'dismiss', :id => @alert, :remote => :true %>
This is the dismiss action from the alerts controller:
# Sets alert dismiss status to true
def dismiss
# Get alert data
@alert = Alert.find(params[:id])
# Update status
@alert.update_attribute(:dismiss, true)
@alert.save!
respond_to do |format|
format.js
end
end
And this is dismiss.js.erb:
$('.systemalert').empty();
Any idea what's wrong? Thanks!