best_in_place
を完全に機能させることに問題があります。問題は、一度フィールドを編集すると、そのフィールドをクリックして再度編集できるようにするために、ページを更新する必要があるということです。私は間違っている可能性がありますが、これはrespond_with_bip
とundefined method
エラーを投げることと関係があると感じています。これは、best_in_place
の資産を適切な場所に置かないことと関係していると思います。現在私は '定数'を更新するために働く以下のものを持っています。それがヒットしたときしかし、再び、それはエラーを投げrespond_with_bip
:best_in_placeのrespond_with_bipはどのように動作させることができますか?
ショー:コントローラの
<%= best_in_place constant, :description %>
更新アクション:のgithubのbest_in_place
からフォルダの面では
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
私のアプリケーションのapp/assets
フォルダにlib/best_in_place
フォルダ全体を置いています。 javascriptファイルはapp/assets/javascripts
にあります(これは心配しないで動作しています)。そして、私はlib/assets/best_in_place.rb
ファイルをconfig/initializers
フォルダーに入れました。
私は間違っていますか?