Category "ruby-on-rails"

React along with Stimulus js in Rails 6

Is there a way to use reactjs along with stimulusjs simultaneously in a an existing rails project? This is not a coding specific question rather an architectura

Heroku doesn't see my changes after git push

I am trying to deploy a new version of my app to heroku and although running it locally works, I can't see any change after I do the following: git push heroku

Revoke access to devise-jwt on Denylist strategy

I am using devise-jwt gem, from what I see on the wrapped gem https://github.com/waiting-for-dev/warden-jwt_auth there is a static method revoke_jwt(payload, us

Adding a default null value to a select tag

I currently have this line of code: =select_tag :resource_id, options_for_select( Resource.find(:all, :conditions => "resourcetype = 'data-sheets' &&

The folder currently open doesn't have a git repository

I am working on a work PC which has a windows OS and I'm used to using ubuntu OS for rails development. I installed everything properly with wsl as ubuntu on VS

Select2 with ajax gets initialized several times with Rails turbolinks events

I am a developing a Ruby On Rails app using Rails 4.2.6. I am using Turbolinks alongside jquery.turbolinks (sorry I could'nt post the links to those elements as

Rails, Capistrano - Compilation failed without serving any debug log

I'm trying to deploy my Rails5 app to AWS EC2 instance using Capistrano3. However when it comes to assets compile, it fails without logging any reasons. Where

Query method issue on rails upgrade to 6.1.5

enter image description here Upgraded rails from 6.0.3 to 6.1.5 but having issues with query methods like eager_load and references. class Note < Application

OpenSSL::SSL::SSLError: hostname "smtp.gmail.com" does not match the server certificate

This is what i have setup in setup_email.rb file, if Rails.env.production? ActionMailer::Base.smtp_settings = { :address => "smtp.gmail

Rails STI query all subclasses using base class

Imagine I have this STI table called living things with these such subclasses: class LivingThing < ActiveRecord::Base end class Animal < LivingThing end

NameError: uninitialized constant when running migration that has an inflected name

I have this migration file 20180226063342_add_bpm_to_songs.rb class AddBpmToSongs < ActiveRecord::Migration[5.1] def change .. end end and this in

Capybara and Factorybot - created data does not appear

I am facing a wired issue, factoryBot is creating a record in Db, but when capybara try to access it, there is no record in HTML. I tried debugging with "byebu

how to check if has_one exists without loading associated model

I have a simple has_one relationship class User < ApplicationRecord has_one :detail has_many :courses end class Detail < ApplicationRecord belongs_

Error when installing Ruby on Rails: "Failed to build gem native extension"

I'm running Crunchbang 11 (Debian-based). I'm trying to install Ruby on Rails, like this: gem install rails --version 4.0.0 I get the error "Failed to buil

Unable to export traces to OpenTelemetry Collector on Kubernetes

I am using the opentelemetry-ruby otlp exporter for auto instrumentation: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/exporter/otlp The otel

Difference between after_create, after_save and after_commit in rails callbacks

The difference between after_create, after_save and after_commit in Rails is that: after_save is invoked when an object is created and updated after_commit is

Undefined method `after_create_commit' for Message:Class Did you mean? after_create - Rails action cable tutorial

I've tried to follow the ActionCable tutorial - Site point and I convert this tutorial to using MongoDB . But I have the problems with devise NoMethodError in

Namespacing service objects in Rails 6 with Zeitwerk autoloader

Rails 6 switched to Zeitwerk as the default autoloader. Zeitwerk will load all files in the /app folder, eliminating the need for namespacing. That means, a Tes

Multiple route aliases in Rails 4

I have a Rails 4 application with some routes: resources :users resources :notifications resources :comments ... My client asked me to have urls in english a

heroku rails build fails with crazy error... possibly node issue?

I have an app that I haven't updated in like a year or so, today I make 1 tiny change, doesn't break anything, but when pushing to master I got a lot of stuff..