Category "ruby-on-rails"

Rails ActiveRecord migration to add foreign key with 'NOT VALID' parameter

Can add_foreign_key add a 'NOT VALID' parameter to the ALTER TABLE command? (Postgres, if it mattters) I have a foreign key between two very large tables. I ne

How to solve importmap bootstrap permission denied issue?

A light Ubuntu user here (WSL). I issued the command in rails 7 (even as the root user) bin/importmap pin bootstrap and ./bin/importmap pin bootstrap but got a

How to use tailwind css gem in a rails 7 engine?

How to use tailwind in a rails engine? According to the documentation supplying a css argument to the Rails generator should work Rails 7.0.2.2 engine generated

rails server not running exiting

This is the output I have obtained when run rails server. I am new to ROR and the version is 3.1.0. Any help would be appreciated I am running this in windows 1

SCRAM authentication requires libpq version 10 or above

i'm trying to implement docker in my rails api but I keep getting this error PG::ConnectionBad: SCRAM authentication requires libpq version 10 or above. I've tr

Show and hide a field depending of a selection from another field rails admin

I would like to know if there is any way to hide or show a field in rails admin based in a real-time selection, for example: I have a form for a channel, where

What can be the reason for 'config.force_ssl = false' in rails app?

I found that config.force_ssl = false in config/application.rb, and nowhere it is defined as true, though the domain have SSL certificate. will there be any spe

Is there a way to get validity (notAfter) from a openssl certificate fingerprint and no certificate?

Is there a way I can determine when a particular certificate fingerprint without having the certificate itself? something like OpenSSL::X509::Certificate.new("-

Creating and migrating a devise-driven User model in a main/replica context

The following main/replica database structure development: primary: <<: *default database: users_development username: deploy_root passw

Change parameter name FORM_WITH VS FORM_FOR

I am using rails 5 and the form_with helper. My code works when using Form_for, but not Form_with. Is the :as parameter not valid with Form_with? View <%= f

Breakpoint not working on VScode for Rspec Rails

Not sure what's wrong with my setup. I've been stuck on this issue for a day now and still hasn't resolved this. I've setup my VScode so I can debug my specs (f

Rails: ActiveSupport::MessageEncryptor::InvalidMessage

Help me please, I've finished 11 chapters of the rails tutorial, deployed my app to heroku (locally it worked perfectly) and it crashing all time. I'm using rai

Rails 7 collection_check_boxes not displaying checked items in edit view

Pursuant to this thread, I've tried to get my code to display which items are already checked when you display an edit view. All other fields are pre-populated

libffi.so.8: cannot open shared object file

I upgraded Rails to 7.0.1. When I do the rails g controller Pages home, it's giving the error: >>rails g controller Pages home /home/shadman/.rbenv/versio

Dockerized Minio for local use not accepting files

I would like to use Minio locally to replicate an S3 like storage. Installed through docker : sudo docker run \ -p 9000:9000 \ -p 9001:9001 \ --name minio

What is perform_async in sidekiq

I want to know about perform_async in sidekiq. As I could not found any documentation on this while everyone is using this. So can someone please explain this

How to add custom font on Rails app (version 7)

In development mode the custom fonts (Raleway) are present but it is not reflected in the staging environment. I deployed my app to Heroku. Added the following

Make Active Storage has_one_attatched not null

I have a model with active storage set up with has_one_attached and some users have hit submit without adding a file to the form. Before I add a validation to t

Rails 7 and Tailwind dynamic classes

I have a Rails 7 app with tailwind where I'm doing something like this: @list = [{name: "Some", width: "3/12"}, {name: "other", width: "6/12"}] # In the view &

bind rails app on the IP provided by the host with 3000 port

I am running the rails app on VPS server provided by my host. I need to run the same local app to the IP provided by them. For eg myip:3000 Is it possible to