2013-06-06 10 views
5

私はgemをRails 3内で使用して、モデルからの結果を返すテーブル内のインプレース編集を実行しています。rest_in_place各ループ内で選択

テキスト入力の編集には問題はありませんでした。私の<td>フィールドのうちの1つでは、フィールドを編集のためにクリックすると、システム内のユーザーを持つユーザーモデルから選択されたドロップダウンボックスが表示されます。

私のモデル内で次のコードを使用しようとしましたが、rest_in_placeはこの要素がフォーム内にあると考えています。

HTML:

<td style="font-size: 10px;"><span class="rest-in-place" data-select="AbaseUser" data-formtype="select" data-object="marketer_import" data-attribute="new_user" data-url="<%= "/marketer_imports/#{marketer_import.id}" %>"> 
    <%= marketer_import.new_username unless marketer_import.new_username.nil? %> 
</span></td> 

Javascriptを:私はクロームコンソール

Uncaught TypeError: Cannot read property 'activateForm' of undefined 

答えて

0

以内に次のエラーを取得する

RestInPlaceEditor.prototype.bindForm = function() { 
    this.activateForm = RestInPlaceEditor.forms[this.formType].activateForm; 
    return this.getValue = RestInPlaceEditor.forms[this.formType].getValue; 
}; 

私はhereを見ることができるように、rest_in_placeがサポートしていません "デフォルトでフォームタイプを選択します(入力&テキストエリアのみ)。代わりにbest_in_placeを使用することを検討してください。 Ryan Batesは素敵なチュートリアルhereを提供しています。

関連する問題