未定义的方法`pageless'在RubyonRails中使用jquery.pageless
undefined method `pageless' using jquery.pageless in Ruby on Rails
我正在尝试实现一个无限滚动,并使用jquery.pageless
但我得到了这个错误:undefined method 'pageless'
我在assets:中的application.html.erb中包含jquery.pageless.js
<%= javascript_include_tag 'jquery-1.3.2.min', 'jquery.pageless' -%>
关于如何解决这个问题,有什么建议吗?
我不知道您为什么要使用以下格式:
<%= javascript_include_tag 'jquery-1.3.2.min', 'jquery.pageless' -%>
应用程序.rb.
在assets/javascript/application.js中,添加以下文件:
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jqeury.pageless
//= require jquery_ujs
//= require_tree .
你需要确保你安装了jquery:
gem install jquery-rails
然后:
bundle install
此外,请确保在application.js文件中提到的路径中有jquery-pageless.js文件,以便它被资产管道获取。
Application.js文件:
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery.pageless
//= require jquery_ujs
//= require turbolinks
//= require_tree .
相关文章:
- RubyonRails——构建交互式接口应该朝哪个方向发展
- RubyonRails中的可点击表行
- RubyonRails-Ajax响应的问题
- RubyonRails环境控制器操作JavaScript响应
- MagnificPopupLightbox在RubyonRails开发中有效,但在部署到Heroku时无效
- 匹配在RubyonRails和JavaScript中加密的签名标头
- 在RubyonRails中创建嵌套表单
- 我可以使用RubyonRails抓取URL的源代码吗?还是应该使用PHP
- 如何将CSS和JavaScript与RubyonRails结合使用
- RubyonRails中的JavaScript表单验证-让JS正常工作,但我该把它放在哪里
- 如何在js.haml文件中编写外部.js文件的内容(RubyonRails)
- RubyonRails ajax发布失败
- this.setState没有重新呈现视图ReactJS和RubyonRails
- jPlayer在RubyonRails应用程序中的基本实现
- RubyonRails:只有我的一些资产(javascript)的资产管道失败
- RubyonRails,simple_form-我想从html select_tag字段中设置simple_form的隐
- RubyonRails:如何将javascript变量传递给params散列
- 在RubyonRails中使用Javascript来调整模式对话框中的滚动条
- 刷新所有信息返回按钮按下:RubyonRails
- 未定义的方法`pageless'在RubyonRails中使用jquery.pageless