Ruby on Rails best_in_place宝石抛出错误 [英] Ruby on Rails best_in_place gem throwing error

查看:85
本文介绍了Ruby on Rails best_in_place宝石抛出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在遵循 https://github.com/bernat/best_in_place 上的指南 当我运行我的应用程序时,出现以下错误:这是什么意思?

I am following the guide on https://github.com/bernat/best_in_place When I run my app I get the error below: What does this mean???

%table
  - @schedules.each do |s|
    %tr
      %td= best_in_place s, :name

$(document).ready(function() {
  /* Activating Best In Place */
  jQuery(".best_in_place").best_in_place();
});

Uncaught TypeError: Object [object Object] has no method 'best_in_place'

推荐答案

删除app/assets/javascripts/best_in_place.js

Remove app/assets/javascripts/best_in_place.js

在视图中包括激活代码:

Include activating code in view:

%table
  - @schedules.each do |s|
    %tr
      %td= best_in_place s, :name
:javascript
$(document).ready(function() {
  /* Activating Best In Place */
  jQuery(".best_in_place").best_in_place();
});

这篇关于Ruby on Rails best_in_place宝石抛出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆