Undefined 不是 Rails 3 in_place_edit 中的函数
我的视图中有一个对象 @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
有人知道我现在必须做什么吗?
I have an object @temp in my view and want to edit the field @temp.name in_place so i used the in_place_edit gem from ruby.
<td><%= in_place_editor_field :temp, :name, {}, :rows => 1 %></td>
The following code is created by that
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})
When visiting the site in my browser I can not click the editable field and get the following error at the line with the Ajax Code:
Uncaught TypeError: undefined is not a function
someone an idea what I have to do now?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
很抱歉提前回答了我自己的问题,但是使用 firebug 进行调试我得到了比 google chrome 更好的异常消息,并发现我还必须在 Rails 中包含 javascript 库效果和控件。
Sorry for the early answering of my own question but using firebug for debugging I got a better exception message than in google chrome and found out that I also had to include the javascript libraries effects and controls in rails.