Questions tagged [ruby-on-rails-7]
For Ruby on Rails 7 questions: Ruby on Rails 7 is a web app framework in Ruby. Use tags like [ruby-on-rails], [ruby], [rails-7], [activerecord], [actionview], [actioncontroller], [routing], [authentication], [authorization], [database], [testing], [deployment], [gems], [api], etc. Provide specific details and errors.
ruby-on-rails-7
1,008
questions
0
votes
0
answers
51
views
ActiveRecord - change in behaviour after rails upgrade from 6.1.7.6 to 7.0.1.7
We have similar logic in our application and that was working fine with rails version 6.1.7.6. After upgrading to rails 7.0.1.7, update_attribute method call at line 35 also inserting records into ...
0
votes
1
answer
42
views
why is mission_control-jobs erroring with load path error?
I have been attempting to set-up mission_control-jobs to a rails 7 app using SolidQueue, but I keep running in to the following error when accessing http://localhost:3000/jobs
Propshaft::...
0
votes
0
answers
28
views
Run `rake -T` on production mode throws errors
When I run Rake -T in production mode, rails throws error about missing pry gem.
Who can help me explain why it happens?
My command: RAILS_ENV=production bundle exec rake -T
Ruby: "3.3.0"
...
0
votes
2
answers
55
views
How do I dynamically update an instance variable using forms?
I'm working on my first RoR 7.1.3.2 project and I've set up a simple form to take customer orders. I have an instance variable called @total and I want to be able to update this total to be equal to ...
0
votes
0
answers
47
views
In Rails 7, what is the right ActiveRecord callback to use if I need to prevent (or rollback) persistance on error?
I'm moving from Rails 6.1 to Rails 7.0, and one of my tests is failing due to a record being persisted into the DB even after an error is raised in the transaction where the saving occurs. Something ...
0
votes
1
answer
125
views
Setting button/other element display state based on form input values using Hotwire Stimulus
I have a form which has a text input, a file input, and a submit button.
I want to modify the display of the button in response to input changes, where it should be enabled if either of the input ...
1
vote
0
answers
45
views
Issues with Turbo Stream updates in Rails real-time voting app with iterative "rounds" after second iteration
I'm working on a Rails application that utilizes Turbo Streams for a real-time voting feature within a game room. Each game room progresses through multiple voting rounds, with a "lock votes"...
0
votes
0
answers
144
views
Toastr rails using importmaps in rails 7
I am having trouble displaying my toast messages in rails using importmaps default setup. This is my code.
This is my layout file
<!DOCTYPE html>
<html>
<head>
<title>...
0
votes
0
answers
154
views
why am i getting an 'unable to lock database: permission denied' error when installing mysql for rails 7 on windows
I have been trying to create a new rails app using mysql and both my windows and linux (ubuntu 22.04) machines are refusing to work. Linux just constantly gives me an access denied regardless of the ...
0
votes
1
answer
211
views
Rails 7 with Turbo & jQuery not working / only working at first page load
I am using Rails 7 with the default turbo installation. I also want to use Materialize CSS and jQuery. The jQuery $(document).ready... functions work on first page load but not ever after.
This is a ...
0
votes
0
answers
16
views
Rails 7 and React monolith having routing errors when the page needs to be refreshed. How do I mitigate this?
Building a Rails 7 app using ESBuild and react in the same project.
The React Router:
app/javascript/routes/index.js
import React from "react";
import { BrowserRouter as Router, Routes, ...
0
votes
0
answers
81
views
Naming conventions for rspec tests with zeitwerk expecting model_spec.rb to define constant ModalSpec
I'm working on upgrading rails, and part of that process involves switching from the classic autoloader to zeitwerk. I've been running bin/rails zeitwerk:check and handling all the cases that come up,...
0
votes
1
answer
64
views
Pass div id to javascript function to show multiple d3 charts on a page
I am trying to display multiple d3 charts on a page using Rails 7 using different div (or svg) ids:
view.html.erb
<%= content_tag "svg", class: 'chart', id: raw(chart_type)+'_'+raw(...
1
vote
1
answer
131
views
ActionDispatch::Http::MimeNegotiation::InvalidType ("html" is not a valid MIME type):
I am upgrading my rails app from ruby 2.4 to ruby 3.2.2 and from rails 5 to rails 7.0.4.3. After upgrading a bunch of gems and getting the app up and running, I started getting the above error. The ...
1
vote
1
answer
50
views
Rails engine: export two sets of routes
I have a Rails engine MyGreatEngine defined in a gem mge. This engine provides two types of routes, one related to APIs and one related to static files.
I would like to export two sets of routes, one ...