0
控制器我有2种型号:AJAX张贴到Rails与外键
class Document has_many :citations end class Citations belongs_to :document end
我怎样才能获得document_id
在客户端添加到文字,我发送到控制器的对象?我发送到CitationsController
的create
方法散列
例子:
$.ajax({ url: url, type: 'post', data: { citation: { document_id: //need this quote: 'quote' } } });
感谢您的帮助!