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
77
questions
46
votes
4
answers
34k
views
How to add custom JS file to new rails 7 project
I created new rails 7 project rails new my_project and have a problem to include my custom JS file to be processed by rails.
my "javascript/application.js"
import "@hotwired/turbo-rails&...
15
votes
5
answers
11k
views
How to call confirm prompt using button_to in Rails with Turbo
Previously in Rails when using the button_to tag, it was possible to use a confirmation dialog like this
<%= button_to 'Destroy', @post, method: :delete, data: { confirm: 'Are you sure?' } %>
...
40
votes
2
answers
21k
views
Could not open library 'vips.42'; Could not open library 'libvips.42.dylib'
When upgrading from rails 6 to rails 7, and running some ActiveStorage methods locally, I see:
Could not open library 'vips.42': dlopen(vips.42, 0x0005): tried: 'vips.42' (no such file), '/usr/local/...
25
votes
3
answers
20k
views
Error: Form responses must redirect to another location
I need to render an html code I receive from an API.
In Rails 6 : I was doing this in my controller, and it was working fine. I called the webservice I received the response, and I was redirected to ...
23
votes
1
answer
11k
views
Rails 7 Dynamic Nested Forms with hotwire/turbo frames
I'm very new to Rails. I've started right from Rails 7 so there is still very little information regarding my problem.
Here is what I have:
app/models/cocktail.rb
class Cocktail < ApplicationRecord
...
17
votes
4
answers
23k
views
How to install jQuery and bootstrap in rails 7 app using esbuild (without webpacker)
I'm trying to create a rails app by installing bootstrap and jQuery.
First I tried to create using
rails new name--css bootstrap
But its not working. So I did it with it manually.
I tried also using ...
16
votes
3
answers
12k
views
Rails UJS not firing with Rails 7
I upgraded my Rails application to Rails 7. I know that Turbolinks and Rails UJS actually are replaced by the Hotwire combination of Stimulus and Turbo in Rails 7, but I wanted to know whether I can ...
6
votes
1
answer
2k
views
In rails, Turbo just appends the response from the server at the end of current page
The problem: Turbo just appends the response from server to the end of current page. Not replacing the page like expected.
Recently upgraded from Rails 6 to 7.
Also I switched from importmap to ...
5
votes
1
answer
4k
views
How to have a delete link respond to turbo_stream and html in Rails 7?
I have a delete link in Rails 7 that functions correctly using either turbo_stream or html, but not each of those.
link_to 'delete', @object, data: { turbo_method: 'delete', turbo_confirm: 'Really?' }
...
11
votes
6
answers
8k
views
Rails 7 asset pipeline SassC::SyntaxError with Tailwind
I'm working on getting a new Rails 7 project deployed to production (trying on both Heroku and Render.com) and am getting the following error during build:
$ tailwindcss -i ./app/assets/stylesheets/...
8
votes
2
answers
2k
views
Rails 7.0.4 and data confirm for link_to doesn't work
My last chance is some last living developer in RoR
Nothing in the darkest corners of the internet works for:
<%= link_to 'some-link', '#', data: { confirm:'Are You Sure?') %>;
it generate this:...
6
votes
1
answer
5k
views
Rails: Turbo Stream Broadcast not updating view
I have a Turbo Stream which is not updating the view and I'm not sure why. I have two other broadcasts setup in a similar configuration which are working fine.
Everything looks like it should be ...
3
votes
1
answer
2k
views
How to load page specific custom Javascript functions in a Rails 7 app with Turbo, ImportMaps and Stimulus?
I just updated my Rails 6 app to Rails 7 and I am finding it difficult to hook my old "Vanilla Javascript" code into Rails' new setup with Turbo, Stimulus, and ImportMaps.
To make things ...
2
votes
2
answers
863
views
Error encountered when running rails new command
I want to start learning Ruby on Rails. I have installed ruby 2.7.0 via RVM. SQLite3 is also installed by default in ubuntu 20.04.3 LTS. My rails version is 7.0.2.2. When I run the command:
rails new ...
14
votes
3
answers
11k
views
Getting a Turbo Frame Error of "Content Missing"
I'm trying to use turbo_frame_tag in my Rails application to manage some tasks. I created a scaffold for my tasks.
I wrapped the page I want to use inside of a turbo frame tag as below:
<%= ...