Category "ruby-on-rails"

tailwind.css not being generated in a Rails 7 project in Heroku

I have a Rails 7 project using TailwindCSS deployed to Heroku that is not building tailwind.css during rake asset:precompile and I don't know why. When I try to

Reasons why Letter_opener would not work anymore?

I have a Rails project and i'm working on 2 computers ( MacBook and Imac ). Suddenly letter_opener stopped to work on MacBook. I recently updated both computers

Rspec Capybara Failure/Error: DatabaseCleaner.clean

I am using rails 6.1.4 (Ubuntu 20.04) and am running tests with rspec, factorybot, and capybara. I also got database_cleaner where I'm using :truncation to star

Collection_select with multiple set as true. Why params[:book][:genre_ids] = ["","1","2"]

I using a has_many :through many-to-many relation in a multi-select via collection_select :multiple => true. I don't understand, why "genre_ids"=>["", "2"

Collection_select with multiple set as true. Why params[:book][:genre_ids] = ["","1","2"]

I using a has_many :through many-to-many relation in a multi-select via collection_select :multiple => true. I don't understand, why "genre_ids"=>["", "2"

Devise forgot password renders wrong template

Rails 6, Devise 4.7.3 I have a forgotten password template in my views as users/passwords/new.html.erb that renders fine, collects an email, and sends that ba

Unable to run Puma as daemon OptionParser::AmbiguousOption: ambiguous option: -d

I upgraded to Puma 5.0.2 and started my rails app as usual with: bundle exec puma -d -e production -b unix:///home/user/app/tmp/puma.sock Now I get the error:

Resource not found errors in Ruby on rails

I know that ActiveRecord::RecordNotFound can be mapped to http 404 error. Is there any other resource in ruby on rails whose non-existence will raise something

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