[英]Rails 6 with Pagy
I'm working on implementing pagy into a Rails 6 app.我正在努力将pagy实施到 Rails 6 应用程序中。 I have the simple pagy_nav links working fine.
我有简单的 pagy_nav 链接工作正常。 Now, I'm trying to implement the pagy_combo_nav_js because some of my instances have thousands of items.
现在,我正在尝试实现 pagy_combo_nav_js,因为我的一些实例有数千个项目。 I've followed the instructions here for Webpacker, but I'm having no luck.
我已按照此处的 Webpacker 说明进行操作,但我运气不佳。 The error I'm receiving is:
我收到的错误是:
ReferenceError: erb is not defined
Has anyone successfully gotten pagy_combo_nav_js working in Rails 6?有没有人成功地让 pagy_combo_nav_js 在 Rails 6 中工作?
You actually missing something like this in a environment header:您实际上在环境标题中缺少这样的内容:
const erb = require('./loaders/erb'); const erb = require('./loaders/erb');
bundle exec rails webpacker:install:erb
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.