ruby-on-rails-6

Rails Leaflet Webpack blank page

情到浓时终转凉″ 提交于 2020-03-23 08:08:10
问题 This a continuation of a related problem that @rossta fixed part of, but now the problem is moved so thought I'd start over. No errors and the script is completing (verified by console.log outputs in the script). The body element shows up. This worked with gem leaflet and now webpack in Rails 5.2, but not now in Rails 6 with webpack I moved the script into the page to isolate the problem map/index.html.erb <p id="notice"><%= notice %></p> <% provide(:title, 'Map') %> <h4>This is map/index

How to fix Rails's warning messages with Ruby 2.7.0

只愿长相守 提交于 2020-03-17 09:54:12
问题 Did anyone resolve this issue with Ruby 2.7.0 ? I used rbenv and installed Ruby v2.7.0 and then created a Rails project using Rails v6.0.2.1 . Currently, by running one of rails s rails s -u puma rails s -u webrick the server is up and the site is served but in the Console log I see two warning messages: local:~/rcode/rb27$ rails s => Booting Puma => Rails 6.0.2.1 application starting in development => Run `rails server --help` for more startup options .rbenv/versions/2.7.0/lib/ruby/gems/2.7

How to skip active record for existing project in Rails 6

元气小坏坏 提交于 2020-02-16 10:41:52
问题 I have an existing Rails project which I created in API mode, using no DB. Upon trying to deploy to Heroku, I am getting lots of ActiveRecord related errors. -----> Detecting rake tasks ! ! Could not detect rake tasks ! ensure you can run `$ bundle exec rake -P` against your app ! and using the production group of your Gemfile. ! rake aborted! ! URI::InvalidURIError: bad URI(is not URI?): ://user:pass@127.0.0.1/dbname ... ... /activerecord-6.0.2.1/lib/active_record/railties/databases.rake 回答1

How to skip active record for existing project in Rails 6

百般思念 提交于 2020-02-16 10:41:30
问题 I have an existing Rails project which I created in API mode, using no DB. Upon trying to deploy to Heroku, I am getting lots of ActiveRecord related errors. -----> Detecting rake tasks ! ! Could not detect rake tasks ! ensure you can run `$ bundle exec rake -P` against your app ! and using the production group of your Gemfile. ! rake aborted! ! URI::InvalidURIError: bad URI(is not URI?): ://user:pass@127.0.0.1/dbname ... ... /activerecord-6.0.2.1/lib/active_record/railties/databases.rake 回答1

How do I redirect after_sign_up_path_for to a create action of another controller?

不羁岁月 提交于 2020-02-06 07:54:10
问题 So I have OrdersController#Create , that I would like the user to be redirected to right after they register (so it can do some post-registration stuff). Before I implemented the registration part of this workflow, this is what the link_to for that resource looked like: <%= link_to 'Submit to Scheduling', orders_path(cart_id: @cart), method: :post, data: { confirm: "Are you sure?" }, class: "primary button btn" %> So basically, I would like to achieve the above functionality (including

Rails 5/6: How to include JS functions with webpacker?

浪尽此生 提交于 2020-02-03 09:22:27
问题 I am trying to update a Rails 3 app to Rails 6 and I have problems with the now default webpacker since my Javascript functions are not accessible. I get: ReferenceError: Can't find variable: functionName for all js function triggers. What I did is: create an app_directory in /app/javascript copied my development javascript file into the app_directory and renamed it to index.js added console.log('Hello World from Webpacker'); to index.js added import "app_directory"; to /app/javascript/packs

Rails 5/6: How to include JS functions with webpacker?

ぃ、小莉子 提交于 2020-02-03 09:22:05
问题 I am trying to update a Rails 3 app to Rails 6 and I have problems with the now default webpacker since my Javascript functions are not accessible. I get: ReferenceError: Can't find variable: functionName for all js function triggers. What I did is: create an app_directory in /app/javascript copied my development javascript file into the app_directory and renamed it to index.js added console.log('Hello World from Webpacker'); to index.js added import "app_directory"; to /app/javascript/packs

How to ignore a folder in Zeitwerk for Rails 6?

让人想犯罪 __ 提交于 2020-02-03 08:36:05
问题 Simple question, but somehow the answer escapes me. In moving to Rails 6 with Zeitwerk, I get: Please, check the "Autoloading and Reloading Constants" guide for solutions. (called from <top (required)> at APP_ROOT/config/environment.rb:7) rails aborted! Zeitwerk::NameError: wrong constant name Enforce-calls-to-come-from-aws inferred by Module from directory APP_ROOT/app/junkyard/enforce-calls-to-come-from-aws Possible ways to address this: * Tell Zeitwerk to ignore this particular directory.

How to ignore a folder in Zeitwerk for Rails 6?

依然范特西╮ 提交于 2020-02-03 08:35:13
问题 Simple question, but somehow the answer escapes me. In moving to Rails 6 with Zeitwerk, I get: Please, check the "Autoloading and Reloading Constants" guide for solutions. (called from <top (required)> at APP_ROOT/config/environment.rb:7) rails aborted! Zeitwerk::NameError: wrong constant name Enforce-calls-to-come-from-aws inferred by Module from directory APP_ROOT/app/junkyard/enforce-calls-to-come-from-aws Possible ways to address this: * Tell Zeitwerk to ignore this particular directory.

Gmaps with Rails 6/Webpack

浪尽此生 提交于 2020-01-25 09:11:26
问题 I'm trying to get my Google Maps setup that previously worked with earlier versions of Rails to display using Rails 6. Obviously Rails 6 is now using webpack to handle javascript assets and I can't get my app to recognie the Gmaps function used to render the map. Some of the basics: Gemfile gem 'geocoder' gem 'gmaps4rails' gem 'underscore-rails' # maybe don't need ^ this underscore gem anymore I installed underscore with yarn add underscore and also added the google maps script gmaps_google