2012-12-11 40 views
17

best_in_placeを完全に機能させることに問題があります。問題は、一度フィールドを編集すると、そのフィールドをクリックして再度編集できるようにするために、ページを更新する必要があるということです。私は間違っている可能性がありますが、これはrespond_with_bipundefined methodエラーを投げることと関係があると感じています。これは、best_in_placeの資産を適切な場所に置かないことと関係していると思います。現在私は '定数'を更新するために働く以下のものを持っています。それがヒットしたときしかし、再び、それはエラーを投げrespond_with_bipbest_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フォルダーに入れました。

私は間違っていますか?

答えて

0

これは役に立ちます。https://github.com/bernat/best_in_place/issues/220私がそこに見ていたものから、それは空白になっているように見え、それはあなたが得るエラーを投げている。それを使用する必要がない場合は、いつでも使用できます:

redirect_to @constant 
関連する問題