Facebook and 406 not acceptable

April 13th 2010

406 Not Acceptable

Keep running into this error when requesting json from rails in a facebook FBML application

solution

Set the content type to ‘text/javascript’; Facebook asks for that when it really wants json. Like this.

respond_to do |format|
  format.json { render :json => 'ok', :content_type => 'text/javascript;' }
end