Category "ruby-on-rails"

Gem::Ext::BuildError: ERROR: Failed to build gem native extension - rbnacl-libsodium 1.0.16

I was trying bundle install and my gem file has gem 'rbnacl-libsodium' it took some time for installation and got failed. Using rbnacl 4.0.2 Fetching rbnacl-lib

How to recognize Id attribute in rails form_tag?

I am using a form in rails to pass an id. That id will trigger the javascript Sweet Alert function which will pop up a modal with a confirmation message. When t

rails tutorial Test errors that occur after Chapter 6

I'm a beginner. rails tutorial I got an error like this when I did a rails test after finishing Chapter 6 and before giving it to git. I did an integration test

getting most liked posts by users using act as votable gem rails

I want to display the top 10 users whose posts got the most likes in past 2 hours, how can I do that inquest index to get user <%@users.each do |user| %>

Error: Unable to load application: NameError: undefined local variable or method `controller_path' for Object:Class - When pushing to Heroku

beginner here learning how to push a project to production. I am pushing my ReactJS app that has a server side and client side to Heroku and have the following

Rails 7.0.4 Error when in run some code of ruby on rails

no implicit conversion of Hash into String class PostsController < ApplicationController @posts = Post.all respond_to do |format| format.html forma

Setting up comfy cms fails with multi-tenancy app

I've got an app for which I'd like to use the comfy cms. I did the following: added gem "comfortable_mexican_sofa", "~> 2.0.0" bundle install rails g comfy:c

Is there a way to keep the order of cases as defined, while running bundle exec rspec {file_path} --format documentation?

I am having a problem while running bundle exec rspec spec/services/abc_service_spec.rb --format documentation The output of it, is not in the same order as th

How to reduce the number of tracking records when saving on keystroke?

When saving changes to a model in rails, two popular gems to track changes are paper_trail and audited. These gems create records that contain versioning inform

How to mock module static method in ruby rspec?

I am trying to write some rspec tests and I want to mock a static method from a module. The setup is like this: module MyModule def self.my_method 'end' en

Configuring vimspector with ruby on rails app running passenger

My question is how do i get vimspector running with a ruby on rails app running passenger (I think) I'm trying to set up vimspector with some ruby on rails proj

Class has leaked into another example and can no longer be used in spec

I'm unable to replicate this locally, but for some reason I am getting the following error when running tests in CircleCi: <Double Mylogger> was originall

NameError: uninitialized constant DeviseController

I have tried upgrading my Rails app from 6.1 to 7 and after running bundle app:update I get the following error: rails aborted! NameError: uninitialized constan

How to add an icon in password field to show & hide password in rails

My code: div.form-group.col-md-12 label =t('.password') = f.text_field :password, required: true,

Rails ActiveStorage Variants url

I'm trying to create an api to get a model's original image and other variants. Right now I'm not storing attachments on external storage, but I plan to save th

How to configure acts_as_tenant gem with ActionCable in rails7

I'm working on a project with I use ActionCable, at the moment I'm learning about acts_as_tenant gem. I implement it in the project, but my WebSockets don't wor

Optimal Nginx and Puma configuration

Production environment: ubuntu 22.04 Puma is NOT installed as a system service Development Environment: Mac OS Rails app: Rails 7 Ruby 3.1 tailwind puma gem i

Ruby on Rails routes - Query parameter vs id

I'm trying to set a route that accepts a dynamic field. Restaurants have categories [:chinese, :fast_food, :french, :vegan] and the route restaurants/vegan allo

Flash is not displayed in the same view in Rails

I need to display flash in the same view (:edit) after successfully updating an object. If I redirect to another action - everything works correctly. But when I

How can I write this in haml? (rails app)

<a href="/"> <i class="material-icons">file_download</i> Export to CSV </a> I am using a material_icon gem. "file_download" is a do