Category "ruby-on-rails"

Node module css import paths work in development, but not in production

I am moving from Webpack to esbuild with jsbundling-rails & cssbundling-rails. I have a folder which imports css libraries from vendors like so: @import "dr

Active storage problem - replacing pictures

I'm using:ruby 2.6rails 6.1.4devisedevise_token_authactive-storage usingl locally disk service I'm creating api in which I can storage and upload pictures. I ca

POST api request in two models in Ruby on rails

I would like users to be able to create a booking, and give it a partner (BookingPartner) in the same request, similar to this "booking": { "address": "

Error on reify a version using ruby PaperTrail

I followed the instructions in https://github.com/paper-trail-gem/paper_trail Added the paper_trail gem in the project Gemfile: gem 'paper_trail' Executed the

Rails Bootstrap 4, dropdown stops working after pressing back button on browser

I'm using Ruby on Rails 6, and I'm importing bootstrap from the application.html.erb file. The dropdown stops working when I press the back button on the browse

Can I make a modification to a child force a validation on a parent when using Active Record Autosave Association?

I am looking for how to trigger a validation on a parent when a child is modified or deleted. Some background in case I am asking the wrong question: I am tryin

Upgrade Ruby 2.6 to 2.7 - WebMock no longer recognizes RegEx patterns on stub requests

I am upgrading a Rails 6.1.4 application from Ruby 2.6.10 to Ruby 2.7.6. With Ruby 2.7.6, WebMock no longer matches the Regular Expressions that worked perfect

Hide default value in form Ruby

I have a form and when I set a value, the value is displayed in the field, how to not display the value but keep the existing values when submitting the form: H

Attach one Active Storage blob to multiple files

In Rails, when attaching a file to an object, is there a way to check if it is already attached to another object? And if so, can I then use this existing attac

Stylesheet renders in grover debug but not on downloaded pdf

I'm using Grover to render and download pdf copies of documents that are generated in my app and am having trouble applying css to it. When in grover's debug m

(Rails 5) LoadError: cannot load such file -- sass ...when deploying to Heroku

I'm getting the error in the title when I deploy my Rails 5 app. I recently updated my Gemfile to include some more recent versions. I don't have any issues on

Slideshow images load on page reload Rails & OwlSlideshow

I'm facing the following problem: I'm using an external API that returns a image hash that has multiple images. When I enter the show page for the element that

Problem when creating mysql database on M1 mac: symbol not found in flat namespace '_mysql_affected_rows

I'm trying to create a db for my rails project using [email protected] which was installed via homebrew. The installation was succesfull, but when I try to run: bin/rak

PG::UndefinedTable: ERROR: relation "entries" does not exist

I'm trying to deploy a simple Rails app in heroku but I'm getting this message in the heroku logs: PG::UndefinedTable: ERROR: relation "entries" does not exist

Ruby on rails turbo current user access

index.html.erb <%= turbo_stream_from "posts" %> <%= turbo_frame_tag "posts" do %> <%= render partial:'posts/post', collection: @po

RSpec: how to chain receive().with()?

I've been writing tests with instance_doubles to stand in for message chains when I need more granularity in the midst of the chain. But, I'm wondering if I'm d

No such directory ruby.exec Errno:ENONT

I'm new to ruby on rails. I installed ruby, sqlite3, node and yarn, run gem install rails and gem install sqlite3. when I run rails new <app_name>, I got

RuntimeError - Unable to find subscription with identifier: when ios app try to send a message

I am using WebSocket for comments on a post. ios user subscribe to the comment_channel and I got confirmation that the user successfully subscribed to comment_c

creating a class object array inside another object?

I've got these three classes class Totalizavel def retorna (qnt, valor) total = qnt * valor return total end end class Venda < Tota

Best practice for similar repeated queries using ActiveRecord

I have a couple simple queries and I'm not sure what the best practice is. I've written them in 2 ways which produce the same result. Which is preferred? Or i