ruby-on-rails-5

Methods like modal() not working if Bootstrap loaded with Webpack (Rails)

安稳与你 提交于 2020-12-12 03:19:10
问题 In my Rails 5 app, if I load Bootstrap 4 using a header <script> tag from a CDN, everything works fine. But when I install Bootstrap (and its dependencies) to node_modules , and serve it with Webpack, it mostly still works... but the jQuery methods Bootstrap is supposed to add like $(foo).modal() or $(bar).popover() give errors in the JavaScript console: Uncaught TypeError: $(...).modal is not a function Uncaught TypeError: $(...).popover is not a function There are several other

Using credentials.yml with heroku on Rails 5.2

Deadly 提交于 2020-12-11 02:08:27
问题 I have an app on Rails 5.2 and it was previously hosted on DigitalOcean, but I need to host it on heroku. I've been reading that heroku can't read Credentials.yml of because it's on gitignore and of course I don't want it public. So my key variables are like this (and example with redis): host: Rails.application.credentials.redis_host, password: Rails.application.credentials.redis_password Heroku can't read this. So my question is what is the best approach to change that in to heroku ENV