ベストインプレースと Twitter ブートストラップで本当に厄介な問題があります。私はそれに多くの時間を費やしてきました。私はいくつかのページを調べました - best_in_place github page と Issues。だから私はそれを修正したと思ったが、修正しなかったし、間違いがどこにあるのかわからない。
最初の編集に best_in_place を使用している場合、機能し、値を保存すると、入力が新しい値で「通常の」ビューに戻ります。しかし、同じアクション(編集)を2回目に実行したい場合、機能しません。ページをリロードする必要があります。その後、もう一度編集できるのは 1 回だけです。私のコードは次のとおりです。
AccountsController.rb
def update
@account = current_user.account
respond_to do |format|
if @account.update_attributes(params[:account])
format.json { respond_with_bip(@account) }
else
format.json { respond_with_bip(@account) }
end
end
end
意見
<%= best_in_place current_user.account, :introduction, :type=> :input,
:nil => "Click me to add your introduction!",
:html_attrs => {:'data-provide' => "typeahead" } %>
account.js.coffee
jQuery ->
$('.best_in_place').best_in_place()
私はすでにこのページを見ましたが、答えが見つかりませんでした: SO Thread、ExampleApp、Best_in_place Issue
誰か助けてくれませんか?おそらくTwitter Bootstrapが原因であることはわかっていますが、修正方法はわかりません:(