1,025 questions
-1
votes
1
answer
102
views
How to make jsbundling-rails and yarn work together?
Issue:
jsbundling-rails can not use yarn build on production server.
Cause:
Inability of to access nvm packages through ssh.
After login on server: which yarn > /home/[user]/.nvm/versions/node/v25....
1
vote
1
answer
82
views
How to directly test ActionController::RoutingError for an invalid path in Ruby-on-Rails-7.1?
In Rails Controller tests of an invalid route, this used to work before Rails-7.1 (in Minitest):
assert_raises(ActionController::RoutingError){ get "/non_existent" }
In Rails-7.1 (or later),...
0
votes
1
answer
268
views
Grover Throwing Javascript Timeout Error in Rails App
I'm getting an error when rendering PDFs with Grover gem in a rails app:
Grover::JavaScript::TimeoutError: Timed out after waiting 30000ms
Couple key points:
Using Grover gem on rails 7 app
Fails in ...
0
votes
0
answers
115
views
How to purge attached ActiveStorage files when updating a record in Rails 7?
I'm using Rails 7 with ActiveStorage to handle file uploads on a Post model. Everything works fine for attaching files, but I'm struggling with removing/deleting an attachment when the record is ...
2
votes
1
answer
80
views
Ruby on Rails Enum ArgumentError
I was wondering if someone can see the obvious error I am making. I can't see it.
My Rails 7.2 application relies on an enum for :likelihood and :consequence. Unfortunately, in testing, I am getting ...
0
votes
0
answers
75
views
After Rails update from 6 to 7, Devise flash messages are not available anymore (Turbolinks disabled)
My Rails app uses Devise (4.9.4) and CanCanCan (3.6.1). I just updated it to version Rails version 7. Since then, the flash messages do not appear anymore when registering as a new user.
I have found ...
0
votes
1
answer
150
views
Rails counter cache for has_one :through on Rails 7 and 8
I am struggling to get a counter cache working on a has_one :through and running into some weird behaviour. I want to have a counter_cache on the Company model that caches the number of associated ...
0
votes
1
answer
60
views
Clearing Fragment Caching from Console
I am new to Rails, going through the caching mechanism and facing a few issues in Fragment caching and not being able to get the solution
In development.rb
config.action_controller.perform_caching = ...
0
votes
0
answers
71
views
Image variants are not processed in Rails 7.0.8 using mini_magick
I have recently upgraded from rails 5.2 to rails 7.0.8 and I am using mini_magick to create image variants. But somehow the image variants are not created.
Gem used:
'image_processing', '~> 1.14'
...
1
vote
1
answer
88
views
actioncable connection lost immediately in production
Actioncable subscribe leads to this error in production:
/home/[app]/.rbenv/versions/jruby-9.4.1.0/lib/ruby/gems/shared/gems/actioncable-6.1.6.1/lib/action_cable/connection/stream_event_loop.rb:74
...
0
votes
0
answers
89
views
Arbitrary Class: Uninitialized Constant Error with string.classify.constantize Rails 7
I'm upgrading a rails app from 5.1 to 7.1.5.1. I have the app working well except for the following issue.
When I try to run
pdf_class = "my_arbitrary_class"
pdf_class.classify.constantize
...
1
vote
0
answers
90
views
Waiting for user to activate email link then continuing with the original page in Rails7
Assume the user is going through steps from 1 to 5, in the last step an activation email is sent to user and then there's a message in step 5 telling the user with a loading icon:
"waiting to ...
0
votes
0
answers
60
views
Changing the language of "The form contains 1 error" in Rails7
In rails7, I have a form, but I want the error messages to be displayed in another language, I can change the ones in the validations in the model e.g. user.rb, but the language of the message that ...
1
vote
0
answers
56
views
Does changing routing url in rails using translated paths affect google search results?
After doing research, I've learned that having 'underscore' in your url path can affect google search results, from this google recommended URL structure:
Google recommended URL structure
I initially ...
0
votes
1
answer
26
views
image filename doesn't show the name of the image but it only shows numbers in rails7
When I write this code to show image filename for the alt :
<img class="card-img-top" alt="<%= store.main_image.filename %>" draggable="false" src="<%= ...