Results for ruby
I would like to convert a couple (start_at, end_at) into an iso 8601 duration, with only 1 periodicity set. For example: 2023/03/01 : 2023/03/10 => P...
I have this simple ruby code. It is the implementation of "proxy pattern". It fails on the last line class ExecuteProxy def initialize(controller_...
I tried every method to install ruby (rvm, rbenv, brew) how do I install ruby on m1 MBA? I used brew to install ruby dipanshukashyap@Dipanshus-MacBook...
I have a Sidekiq project running a task creates multiple child records and updates the parent record to which this child object belongs. The database ...
how do you print Hello World in Ruby? I tried multiple times, but it did not work. I am hoping to learn Ruby. I tried this but it did not work: printf...
I am working with Ruby On Rails and I have two SQL queries where each returns an array of objects. These two SQL queries are from two seperate DB's so...
I have several methods with keyword parameters which call other methods with the same parameters. Currently I have to pass each parameter manually. Is...
Say I have a ruby Hash with a single property that is a very large string. It's so large that compressing the string may make sense. Compressing the...
Hello community I am new to ruby on rails, I have a problem with updating the database, when I try to update a record, all records are updated this is...
On this interesting blog post about pattern matching, there is some code with a method signature of (*) class Request Data.define(:path, :scheme, :for...
I like to use the Array#union or #| method to return an array of objects where duplicates are removed. I have a custom implementation of eql? on my cl...
I've downloaded and installed the latest version of Ruby Ruby+Devkit 3.2.2.1(x64) from this link:https://rubyinstaller.org/downloads/ Run the command ...
Given the controller awesome_app_controller.js, registered as awseome_app export default class extends Controller { static targets = ['input']; } Th...
I have ruby that was installed via brew, I updated the version via brew, but I can't change the default version being used. Can you give me a hand? E...
I am writing an app that requires me to divide a given number of users into two or more groups, each containing 3, 4 or 5 users. There can be any numb...
I just updated my rails app from ruby 2.7.0 to 3.2.2 and a following code: class TemplateField ApplicationRecord enum group: { 'primary': 'pr...
I have a nested hash that looks something like this: main_hash = [[ {"a"=>{:x=>70.1}, "b"=>{:x=>97.17}, "c"=>{:x=>97.25}}], [{"a"=>{:x=>70.05}, "...
I have an api request that returns multiple (Word) files to-be-downloaded, but I can't send_data IN the while loop, else I'll get the dreaded Multiple...
so for some reason my Ruby encounter this error when I try to create a new application on Windows 10: rails aborted! URI::InvalidURIError: bad URI(is ...
I have found the following expression in a very old piece of code: def reason self[:reason].try(:to_sym) end This is a method in an ordinary model c...
I'm new to Ruby and Rails, and my rails installation cannot run in the CLI because it is looking for Ruby in the wrong place. TLDR question - How can ...
I have an issue with very simple piece of code: def cond(x,y) if x =~ /#{y}/ puts "ok" else puts "not o...
arr = [1,4,6,3] arr2 = [3,4,3,6] arr.each do |item| p "X" if arr2.include?(item) end but the above only returns X if the element is found but I wan...
Since the release of CFT (Chrome For Automation), it's possible to specify the browser version in Selenium. I've come across a Java solution that acco...
I'm in kind of a pickle. I installed Ruby with scoop on Windows 10. Then I chose ruby executable in RubyMine - scoop/apps/ruby/current/bin/ruby.exe Fo...
How do I undo the most recent local commits in Git?
How can I remove a specific item from an array in JavaScript?
How do I delete a Git branch locally and remotely?
How can I find all files containing a specific text (string) on Linux?
How to find all files containing specific text (string) on Linux?
How do I revert a Git repository to a previous commit?
How do I create an HTML button that acts like a link?
How do I check out a remote Git branch?