338,179 questions
0
votes
0
answers
26
views
How to avoid checkout payment race conditions with limited stock? Rails 8
I am building an e-commerce with Rails 8 and Stripe through their API for a pottery business. These are all unique, one-off items for now and with the demand she already has, I anticipate her site ...
0
votes
0
answers
75
views
rails 8 error: Uncaught SyntaxError: import declarations may only appear at top level of a module
I have a new Rails 8 application built with Bootstrap, Ruby 3.4.7, MySQL, and Haml, running in Firefox 145.
It all looks good, except for the uncaught exception:
Uncaught SyntaxError: import ...
0
votes
0
answers
49
views
Rails App, Auto loading files during initiliase phase
I have a Rails 8 app that is pretty bare boned.
I'm just setting up my dependency injection container, which registers relevant services here at:
config/initializer/command_bus.rb
The issue is that I'...
-3
votes
0
answers
91
views
Error in PostgreSQL when running Rails and PostgreSQL using Docker Compose
When I run the command on docker container backend:
psql -h localhost -p 5432 -U postgres
I receive the following error:
psql: error: connection to server at "localhost" (::1), port 5432 ...
0
votes
0
answers
48
views
MiniMagick/ImageMagick produces Grayscale PDFs(contains colourful images) inside Docker, but Color PDFs Locally (Rails 8)
The Problem Statement
My Rails 8 application uses MiniMagick to composite multiple color JPEG/PNG images onto a single blank page, draw bounding boxes, and output the result as a PDF.
When running the ...
0
votes
1
answer
47
views
Assertions for travel_to with attribute-based timezone
At 10 a.m. an object becomes active and visible to the user.
seconds_since_midnight.to_i at 10:00 is 36000, but that is not timezone aware.
application_controller sets a tenant and its timezone, based ...
0
votes
0
answers
54
views
Getting Rails 6 error after upgrading from 5.2 to 6.0.6 [duplicate]
Here is the error:
bundle exec rails app:update:bin
/home/ubuntu/.rvm/gems/ruby-3.1.2/gems/activesupport-6.0.6.1/lib/active_support/logger_thread_safe_level.rb:16:in `module:LoggerThreadSafeLevel': ...
0
votes
2
answers
58
views
Can't connect to MongoDB Atlas (free tier)
I'm struggling to connect from my Rails deployment to an Atlas Cluster.
This is my MONGODB_URI:
mongodb+srv://JohnDoe:****@cluster0.*****.mongodb.net/XYZ_prod?retryWrites=true&w=majority
The ...
0
votes
0
answers
57
views
Properly submitting array of data for a minitest
The following params are submitted in different actions the following manner
?acc_ids%5B%5D=246&acc_ids%5B%5D=247&acc_ids%5B%5D=248 with Parameters: {"acc_ids"=>["246", &...
0
votes
0
answers
52
views
How to add [page] , [topage] in the body of PDF [closed]
I am confused about generating the PDF. I have a case
Table of content
A-1 .......................................................................... 2
B-2 ..............................................
0
votes
2
answers
81
views
error installing rails - alternate installation path possible
I want to install Rails on Windows using the procedure described in the official Ruby guide.
When I enter
gem install rails
I get the error message:
Permission denied @ rb_sysopen - /var/lib/gems/3....
0
votes
1
answer
64
views
Problem with migrated rails 8 sprockets/importmap sprockets errors on app/javascript files
I upgraded an app from rails 5.2 to 8.0.4, still using sprockets to load all assets, but everything was working properly. I then added importmaps and migrated all my javascript files to importmap. I ...
0
votes
1
answer
100
views
Turbo Rails (8x) with `link_to` raises "Can't verify CSRF token authenticity"
I have a button_to tag, with data: {turbo_method: :post}
This works.
When I change it to link_to it breaks with Can't verify CSRF token authenticity.
Is this a bug? It seems that it should work ...
0
votes
1
answer
52
views
ActiveAdmin complaining about ransackable_atttributes
I'm currently trying to migrate to activeadmin 3.0.0, which requires ransackable 4.3.0. This breaking change require to add ransackable_attributes and ransackable_associations as class methods in my ...
0
votes
1
answer
75
views
Rails 8 importmap and chart.js
Installing chart.js to Rails 8 with importmap
Install package
bin/importmap pin chart.js
Pinning "chart.js" to vendor/javascript/chart.js.js via download from https://ga....