Rails 2.3 の新機能のおかげで、エンジンのようなプラグインを作成しました。これは、CMS の「製品」モジュールであり、既存の (および動作中の) モデル/コントローラーから推測されます。プラグインは easy_fckeditor と globalize (説明とタイトル フィールドがローカライズされています) に依存しており、globalized が原因ではないかと思います... update アクションを除いて、すべて正常に動作します。次のエラー メッセージが表示されます: (最初の行だけを投稿します。すべてのメッセージは attribute_methods に関するものです)
stack level too deep
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:64:in `generated_methods?'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:241:in `method_missing'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:249:in `method_missing'
参照用に、完全なエラー スタックはこちら: http://pastie.org/596546
すべての入力フィールドを 1 つずつ削除してデバッグしようとしましたが、エラーが発生し続けます。fckeditor が原因ではないようです (fckeditor がなくてもエラーになります)
これはアクションです:
def update
params[:product][:term_ids] ||= []
@product = Product.find(params[:id])
respond_to do |format|
if @product.update_attributes(params[:product])
flash[:notice] = t(:Product_was_successfully_updated)
format.html { redirect_to products_path }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @product.errors, :status => :unprocessable_entity }
end
end
end
ご覧のとおり、非常に簡単です。