我怎样才能获得best_in_place的respond_with_bip工作?

pit*_*hip 18 ruby-on-rails-3.1 best-in-place

我在best_in_place完全正常运行方面遇到了麻烦.问题是,一旦我编辑了一个字段,为了能够再次点击并编辑该字段,我需要刷新页面.我可能错了,但我觉得这与respond_with_bip抛出undefined method错误有关.我认为这与不将best_in_place资产放在正确的位置有关.目前我有以下内容可以更新'常量'.但是当它击中时它再次抛出错误respond_with_bip:

节目:

<%= best_in_place constant, :description %>
Run Code Online (Sandbox Code Playgroud)

更新控制器的动作:

def update
  @constant = Constant.find(params[:id])

  respond_to do |format|
    if @constant.update_attributes(params[:constant])
      format.html { 
        flash[:success] = "Constant Updated"
        redirect_to settings_path
      }
      format.json { 
        respond_with_bip(@constant) 
      }
    else
      format.html { 
        flash[:error] = "Constant Update Failed"
        @title = "Constants"
        @constant = Constant.new
        @partial_path = "settings/constants"
        redirect_to settings_path
      }
      format.json { respond_with_bip(@constant) }
    end
  end
end
Run Code Online (Sandbox Code Playgroud)

best_in_placegithub页面的文件夹方面,我将整个lib/best_in_place文件夹放在我的应用程序的app/assets文件夹中.javascript文件在app/assets/javascripts(这些工作,所以不担心它).我把lib/assets/best_in_place.rb文件放在文件config/initializers夹中.

我究竟做错了什么?

Tim*_*m R 1

这可能会有所帮助,https://github.com/bernat/best_in_place/issues/220。从我在那里看到的情况来看,它看起来像是一片空白,这引发了您遇到的错误。如果您不需要使用它,您可以随时使用:

redirect_to @constant
Run Code Online (Sandbox Code Playgroud)