Category "ruby-on-rails"

Rails architecture issue

I have an app where I have a list of Cars. I have a form above that can filter them based on different attributes. I wish to add filtering based on their model

visit_Psych_Nodes_Alias: Unknown alias: default (Psych::BadAlias)

I updated from ruby 2.7.1 to 3.1.1, then removed Gemfile.lock and ran bundle update (it's on a dev branch, so I can throw it away if this is a bad idea, I just

how to get specific value cell index using rubyXL gem

I have a static header in my excel template and I want to find each column cell index using cell value. Example: Row1: cell1, cell2, cell3 I want to find the ce

Flatpickr onChange event to set end_date

I have two date pickers using flatpickr() - start_time and end_time. When the start_time is selected, I need the end_time to be changed to the same value that w

How to make data:{confirm..} work in rails 6 | button_to

my confirm popup not working in rails 6. I added gem 'jquery-rails' to GEMFILE and run bundle install. I also added //= require jquery //= require jquery_ujs t

CKEditor: [CKEditorWebpackPlugin] Error: Too many JS assets has been found during the compilation

I am updating the CKEditor packages in my Rails/React app from ~12 to the latest version 27. When running the app locally in my webpack-dev-server I see this e

Rails helper doesn't have access to base class method

I've got helper which I'm including inside Create service class. This Create service inherits from Base class and I'm including ::Imports::HashFieldsBuilder to

Rails/Heroku, switching between databases multiple times yields "can't create Thread: Resource temporarily unavailable" error

Setup: Ruby 2.5.9, Rails 5.2.2, Heroku-18, Postgres Issue: I'm running a task on my Heroku staging database which compares data from two different databases (bo

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, dat

ActiveJob custom serializer - uninitialized constant NameError

I am trying to add a custom serializer to ActiveJob following the ActiveJob Rails Guide. I have the following class, originally in the file app/lib/money_serial

Error when trying to include Devise::Test::ControllerHelpers

I'm trying to get started with controller tests, and I'm not sure what I'm doing wrong. Here's my code, and the error it's producing: require 'test_helper' cla

In Rspec, how do I set the VCR record mode in the feature description?

I have a test that uses VCR like this: describe 'Do something with an api', feature: true, js: true, vcr: true do end I want to set this vcr recording to the op

How can I disable Hotwire / Turbo (the Turbolinks replacement) for all forms in a Rails application?

In Rails 7, Turbolinks is replaced by Hotwire / Turbo. This patches up web links so that they become AJAX-style requests just like Turbolinks did, but also patc

Order AR by enum and after, a random list

I have a user model with enum level and an each user has_many books enum level: { member: 0, supporter: 1, pro: 3, partner: 4 }, _prefix: :level I would like

Associate Active Record tables through non-primary, non-unique column in Rails

I have a table "films" whose schema looks like this: create_table "films", force: :cascade do |t| t.integer "tmdb_id", null: false t.string "language_is

Associate Active Record tables through non-primary, non-unique column in Rails

I have a table "films" whose schema looks like this: create_table "films", force: :cascade do |t| t.integer "tmdb_id", null: false t.string "language_is

couldn't find file 'owl.theme.default' with type 'text/css' error in rails 5.1.4

im getting the below error. Sprockets::FileNotFound at / couldn't find file 'owl.theme.default' with type 'text/css' Checked in these paths: /home/xyz/abc/pr

conditionally have css tag inline in slim

I have a set of css tags like this: .card.hidden.small.u-margin-bottom-1 I'd like to conditionally show the .hidden tag while maintaining this style of syntax

BUILD FAILED (Ubuntu 20.04 using ruby-build 20210119)

I'm using rbenv and in Ec2 instance I'm trying to install a ruby different version but when I execute rbenv install 2.7.2 following errors occur. Downloading

How to pass a File JS object to Rails controller

I have a JS file object (like the one below) that I'd like to pass to my rails controller. File {name: 'undefined', lastModified: 1652457009460, lastModifi