Category "ruby"

How to use stimulus components with rails import maps

I want to include this stimulus component into my brand new rails 7 app: https://www.stimulus-components.com/docs/stimulus-dropdown When I follow their setup ap

Opening ruby app from Rubymine terminal

I just got Rubymine and getting used to ruby on rails on mac , Im wondering if there is any command to open a ruby app on Rubymine 7 , from terminal would th

Divider in divs with Tailwind

I have this now <div class="w-2/3"> <h2 class="text-2xl font-semibold">Ordered Items</h2> <table class="w-full border-collapse"> .....

Could not find public_suffix-2.0.4 in any of the sources

It started when I tried to add the Google Tag Manager Gem to my local installation of Jekyll. A little background here, I'm using homebrew and rbenv. My r

Change the default value for table column with migration

I try to change the default column value from false to true. But when I run rake db:migrate VERSION=904984092840298 I got the following ERROR. StandardError: A

Why won't Rails.cache store API responses?

I am trying to cache the results of API calls. My application makes multiple calls with the same result and I would like it to use the cache to save time. When

The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256

I get an error AWS::S3::Errors::InvalidRequest The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256. when I try upload fi

Use Ruby's heredoc syntax to read a regular expression

In my tests, I have a - somewhat longer, multi-line - HTML response containing a date and time. I thought I could use assert_match to compare the expected resul

How can i create JSON array of JSON objects in ruby from a loop

I am trying to loop through some video objects and i am trying to build a JSON array that looks like this: [{"event_name":"video_completed","object_id":1234567

How to zip every element of array to every element of another array in ruby?

Say I have this array: [0, 1, 4], [2, 3] How can I merge them to get: [0,2], [0,3], [1,2], [1,3], [4,2], [4,3] I tried: [0, 1, 4].zip [2, 3] But I got:

How i can receive variable from another thread in Jmeter

in the first thread, I received JSON (format - {"id":6054,"name":"Jmeter created chat","description":"jmeter created test"}) I want to use it in the second thre

Rspec 3 how to test flash messages

I want to test controller's action and flash messages presence with rspec. action: def create user = Users::User.find_by_email(params[:email]) if user

Regex matching plus or minus

Could someone please look at the following function and explain the regex for me as I don't understand it and I don't like using something I don't understand as

Creating a directory called 'con'

In the Ruby console, whenever I try to make a folder 'con', I get the following error: > FileUtils.mkdir_p('con/') Errno::ENOTDIR: Not a directory - con

How do I access class variable?

class TestController < ApplicationController def test @goodbay = TestClass.varible end end class TestClass @@varible = "var" end and i get erro

rdkafka 0.8.1 ERROR: Failed to build gem native extension

I'm runnning bundle install Then I get this error: Fetching rdkafka 0.8.1 Installing rdkafka 0.8.1 with native extensions Gem::Ext::BuildError: ERROR: Failed to

$(document).ready does not work in Rails

I'm using a *.js.erb in my Rails-App, which reacts to a clicked Link. But when I render my page, by getting there via a link_to, I have to refresh the Page, to

Convert Ticks to @timestamp in logstash with Ruby-plugin

I query every minute against a MSSQL Database with jdbc-plugin. In this Database my timestamp is stored in ticks. Field-name is lastupdate. Now I wanted to conv

Failed to build gem native extension (installing Compass)

When I attempt to install the latest version of compass (https://rubygems.org/gems/compass/versions/1.0.0.alpha.17), I get the following error. ERROR: Error i

full width responsive image with image tag in Rails 4 app

Im using the code below to make header images appear randomly in a app I´m making. I want the images to span the whole width of the screen but somehow it