Questions tagged [rails7]
48 questions
5
votes
2 answers
Using chart.js with importmaps in rail 7
I am trying to integrate chartjs with importmaps in rails 7 but its not working
I have tried with following procedure
bin/importmap pin "chart.js@^3.8.0" --download
here is my application.js
import 'chart.js'
I am getting following error…

Waleed badar
- 61
- 4
3
votes
1 answer
fire event from external controller
i'm moving to Rails 7 and i feel like there are so many changes but i'm confident on understanding them and be able to upgrade a personal applications i made myself for keeping my personal records and appointments
More specific i need to communicate…

barone
- 33
- 4
3
votes
1 answer
debug session doesn't work with debug gem
I am making a personally developed application.
I have tried to debug with debug gem which became standard from rails 7, but (rdbg) does not work smoothly even if I enter debug session. I don't know what is the cause. Please let me know if any…

mojaomi
- 115
- 6
3
votes
1 answer
Rails 7 + Turbo: Turbo navigates away when receiving 422 unprocessable entity
According to various sources, the way to fail form validation in Rails 7 is to respond with status 422 unprocessable entity. However, in my case, this causes Turbo to issue yet another GET request, which is unlikely to be the desired outcome.
The…

Kalsan
- 822
- 1
- 8
- 19
3
votes
1 answer
Ruby on Rails 7 Action Cable
I've upgraded from Rails 6 to 7 and now my action cable channels are not listening anymore. I'm sure it's a silly mistake but for the life of me I cannot track it down.
app/javascript/channels/consumer.js
import { createConsumer } from…

epurdy
- 151
- 1
- 12
2
votes
0 answers
ActiveStorage: TypeError Exception: no implicit conversion of String into Hash
After Rails update from 6.1 to 7.0.3, I start getting ActiveStorage errors while calling something like
object.document_attachment.url
it throws the error *** TypeError Exception: no implicit conversion of String into Hash
One quick solution…

Touseef Murtaza
- 1,548
- 14
- 20
2
votes
1 answer
Rails 7 turbo-stream broadcast to specific channel not working
I have a Post model and Comment, and Post has_many Comment and I wanna real-timely update the comment when you are in a specific post, meaning, the comments live-updating should only visible when multiple users are in the same post, for example: in…

Invincible_Pain
- 491
- 2
- 6
- 17
2
votes
0 answers
Have current rails 5 heroku app - how do I start a new version on rails 7 without screwing up my current deployment?
I have a current Rails 5 app with my current database running on Heroku. What I would like to do is create a new version of my app using Rails 7, that uses a modified database (that adds some additional attributes). How do I set this up (maybe using…

mksys
- 21
- 1
1
vote
2 answers
How can I disable ActiveSupport::Notifications on Rails 7?
I'm trying to upgrade my API from Rails 6 to Rails 7, and got this error after solving dependences and running my app:
Error:
ActiveSupport::Notifications::InstrumentationSubscriberError (Exception(s) occurred within instrumentation subscribers:…

dfop02
- 19
- 5
1
vote
0 answers
how to refer to a rails image asset in JSX and Rails 7 (esbuild)
Can't figure out how to get an asset path in JSX that is processed byjsbundling-rails/esbuild:
I've seen that in the source code of cssbundling-rails the url() is gsubbed and urls are replaced with the whole…


pixelearth
- 13,674
- 10
- 62
- 110
1
vote
2 answers
Insert dynamic class assignment to a Rails link_to tag
I am trying to add a dynamic class to a link_to in Rails 7. I have the following code, but it's not inserting the appropriate content based on the request.env["PATH_INFO"]...
-
<% %w[blog headlines network].each do |nav_link| %>
…

Matteo
- 1,136
- 1
- 16
- 36
1
vote
1 answer
wrong constant name ....... inferred by Module from file
Ruby 2.7
Rails 7.0.3.1
/home/felipe/.rvm/gems/ruby-2.7.1/gems/zeitwerk-2.6.0/lib/zeitwerk/loader.rb:359:in `rescue in block in set_autoloads_in_dir': wrong constant name Usersession.controller inferred by Module from file…

TrindadeF
- 11
- 3
1
vote
1 answer
JS package not working with Rails 7 importmap
I have a Rails 7 app that is trying to use the @walletconnect/web3-provider npm package. After running ./bin/importmap pin @walletconnect/web3-provider@1.7.5, a bunch of JS modules get pinned in importmap.rb:
pin "@walletconnect/web3-provider", to:…

septerr
- 6,445
- 9
- 50
- 73
1
vote
0 answers
Rails 7 Bootstrap Dropdown is adding # to url
I have the most frustrating issue on my rails 7 app. None of my bootstrap drop downs(dropdown buttons or dropdown nav) will work, they add a hash to my url.
I am using the jumpstart template https://github.com/excid3/jumpstart
For instance when I…

Joe Bloggos
- 889
- 7
- 24
1
vote
1 answer
unexpected callbacks behaviour in rails 7
I've been trying to migrate my codebase from rails 5 to rails 7 and there are some issues with callbacks which I'm unable to figure out
Issues:
When multiple callbacks like after_create_commit and after_update_commit are supposed to trigger the…

SAKSHAM SHARMA
- 13
- 1
- 3