1

我的视图中有一个对象@temp,并且想要编辑字段@temp.name in_place,所以我使用了ruby 中的in_place_edit gem。

<td><%= in_place_editor_field :temp, :name, {}, :rows => 1  %></td>

以下代码是由它创建的

new Ajax.InPlaceEditor('temp_name_5_in_place_editor', '/temps/set_temp_name?locale=en&id=5', {callback:function(form) { return Form.serialize(form) + '&authenticity_token=' + encodeURIComponent('OX1qBv+oX0BgdF7uq7UM5rzGacmY/9ZLerE6osA6HnI=') }, rows:1})

在我的浏览器中访问该站点时,我无法单击可编辑字段并在 Ajax 代码行出现以下错误:

Uncaught TypeError: undefined is not a function

有人知道我现在要做什么吗?

4

1 回答 1

0

很抱歉我自己的问题的早期回答,但使用萤火虫进行调试我得到了比谷歌浏览器更好的异常消息,并发现我还必须在 rails 中包含 javascript 库效果和控件。

<%= javascript_include_tag "prototype", "effects", "controls" %>
于 2011-09-06T09:55:54.823 回答