13

私のページにはレコードのリストがあります。AJAX を介してリモートでフォームを送信すると、新しいレコードがリストに追加されます。すべての best_in_place 機能は、:nil オプションとは別にすぐに機能します。これは、設定したデフォルト値を表示しません。これにより、ユーザーがページを更新しない限り、値を編集できなくなります。その後、値が表示され、ユーザーはクリックできます。

これは既知のバグですか? 誰でも回避策を提案できますか?

私のコードで更新:

<%= best_in_place_if can?(:update, post), post, :post_type, :path => account_post_path(account,post), :type => :select, :collection => Post::POST_TYPES.zip(Post::POST_TYPES), html_attrs: { "class" => "span2" }, :nil => "Click to assign" %>

これは、create.js.erb ファイルを介して挿入される _post.html.erb という名前のパーシャル内にあります。

$("#js_posts").prepend("<%= escape_javascript render 'post', :post => @post, :account => @account %>");
$("#js_add_post_button").button('toggle');
$("#js_add_post").collapse('hide');
$("#js_add_post").html("<%= escape_javascript render 'add_post', :new_post => Post.new, :account => @account %>");
4

0 に答える 0