Weird “406 not acceptable” error

前端 未结 12 1121
南方客
南方客 2020-11-27 05:38

When I try to hit this action via Javascript, I get a 406 Not Acceptable error:

  def show
    @annotation = Annotation.find_by_id(params[:id])
         


        
12条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 06:21

    Just use this code in controller action method format block:

    format.js   { render :nothing => true }  
    

提交回复
热议问题