Ruby on rails 3.1 我怎样才能得到最好的位置';让我们用bip工作来回应你?
我很难让Ruby on rails 3.1 我怎样才能得到最好的位置';让我们用bip工作来回应你?,ruby-on-rails-3.1,best-in-place,Ruby On Rails 3.1,Best In Place,我很难让最佳位置完全发挥作用。问题是,一旦我编辑了一个字段,为了能够再次单击并编辑该字段,我需要刷新页面。我可能错了,但我有一种感觉,这与respond\u with_bip抛出未定义方法错误有关。我认为这与没有将最好的资产放在正确的位置有关。目前我有以下更新“常量”的方法。但当它点击respond\u with_bip时,它再次抛出一个错误: 显示: <%= best_in_place constant, :description %> def update @constan
最佳位置
完全发挥作用。问题是,一旦我编辑了一个字段,为了能够再次单击并编辑该字段,我需要刷新页面。我可能错了,但我有一种感觉,这与respond\u with_bip
抛出未定义方法
错误有关。我认为这与没有将最好的资产放在正确的位置有关。目前我有以下更新“常量”的方法。但当它点击respond\u with_bip
时,它再次抛出一个错误:
显示:
<%= best_in_place constant, :description %>
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
关于best_In_place
的github页面中的文件夹,我将整个lib/best_In_place
文件夹放在我的应用程序的app/assets
文件夹中。javascript文件位于app/assets/javascripts
中(这些文件工作正常,不用担心)。我把lib/assets/best\u in_place.rb
文件放在config/initializers
文件夹中
我做错了什么?这可能会有所帮助。从我在那里看到的,它看起来是一个空白,这是抛出你得到的错误。如果您不需要使用它,您可以始终使用:
redirect_to @constant