Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I import recurring_select in Rails 7?

jose Tomas anabalon asked in General

I add the gem in rails 7 and worked, the thing is, when I'm using it in the form, it doensn't pop up the modal, the js isn't working,
In application.js I imported like
import "recurring_select"

importmap.erb
pin "recurring_select", to: "https...cdn.../npm/recurring-select@0.1.0/"

Does anybody knows how to make it work in rails 7?

Reply

Not helpful in your situation, but in case anyone else finds this, I'm using esbuild and require("./recurring_select/recurring_select.js.coffee"); worked in my application.js

You will need to include coffeescript transpiler in your build process. Chris produced a helpful video about this if you are using esbuild: https://gorails.com/episodes/esbuild-jsbundling-rails

Reply

Ever find a solution to this? Struggling to get this installed in rails 7.

Reply

This is not a solution and the code is bad, but since the NPM package is outdated as well as the ruby gem, it at least "works" in Rails 7: https://github.com/robault/event_scheduling

Uses an updated version of the Ruby gem to Rails 7.0.4 and Ruby 3.2.2: https://github.com/robault/recurring_select

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 78,890+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2023 GoRails, LLC. All rights reserved.