Ruby on Rails, threading in DelayedJob workers
I'm working on a Ruby on Rails web project that runs on Puma server, also has several DelayedJob Workers on different servers.The project generates some special logs that i want to send to AWS Sqs...
View ArticleHow to get value from form in ruby on rails
I am working on a ruby on rail project recently and I have to customize the devise recoverable controller by myself.Here is the code in the devise/view<%= form_for(resource, as: resource_name, url:...
View ArticleVerifying Google Identity OAuth2 token with Ruby
I have a Rails API with a variety of frontend clients.I’m setting up Google Sign-in/up with OAuth2 (via Google Identity), and am having issues verifying the token that comes from Google - it seems...
View ArticleCould not find gem 'wdm (~> 0.1.1) mingw, x64_mingw, mswin' in locally...
I am new to Jekyll. I tried to start a Jekyll project but wdm didn't install. While trying to run the local server on my machine with bundle exec jekyll serve I got the following...
View ArticleWhy is Pathname not considered a string (or when is it okay to add a to_str...
There was a bug report Pathname#to_str doesn't appear to work anymore. Having to_str in Pathname would let you use Pathname anywhere you use a string, eg with Dir, system, etc. However the bug report...
View ArticleNokogiri grab only visible inner_text
Is there a better way to extract the visible text on a web page using Nokogiri? Currently I use the inner_text method, however that method counts a lot of JavaScript as visible text. The only text I...
View ArticleHow to make distributable ruby binary? [closed]
I have some ruby scripts that i want to package in exe to distribute, theres a way to do this without expose source code?I have not found any solution to achieve this.
View ArticleWhy does adding unique constraint removes the index in structure.sql file and db
PreambleInitially this question was marked as duplicate of: Postgres unique constraint vs indexbut I'm not asking the differences of unique constraint vs unique index, that's why I updated the question...
View ArticleAdd a configurable product to Magenta cart using SOAP V2 (Savon gem)
I'm stuck in a very common problem, but all solutions I'm finding are for PHP instead of Ruby.I'm using Savon gem (https://github.com/savonrb/savon) to communicate with the Magento API SOAP V2.I try to...
View ArticleHow to see output of rake tasks after closing the terminal window?
I have a rake task that requires several hours to run. I logged into my server, ran there the rake task and watched the outputs generated inside the terminal window.Then my internet connection broke....
View ArticleTrying to install Ruby on windows to download website
Good day,I've been working on a project that involves using Ruby. Despite several attempts, I haven't been successful in installing it.I'm attempting to download a website with the Wayback Machine...
View ArticleCan't make a new line in slim template
My code is the below.mails_preview.rbsummaries = ["test\ntest\ntest\ntest", "test\ntest\ntest\ntest"]ClientsMailer.test(summaries)clients_mailer.rbclass ClientsMailer < ApplicationMailer def...
View ArticleRails: How to configure the logger for the Rails Action Mailer
I would like to set up the logger option of the Rails Action Mailer, but the only info I found are these lines over at ruby on rails guides Action Mailer Configurationlogger: Generates information on...
View ArticleJSON transformed to Hash when using credentials and fixtures
I am creating tests for my Ruby on Rails (7.2, Ruby 3.3.3) application.The App uses Google Drive APIs. In order to avoid going through OAuth2 steps when testing, I want to put the Google Drive...
View ArticleCoercion error when passing Boolean argument in graphql-ruby mutation query
I have a simple graphql-ruby mutation:class Mutations::User::Destroy < Mutations::BaseMutation argument :confirm, GraphQL::Types::Boolean, required: true payload_type GraphQL::Types::Boolean def...
View ArticleCreate a new Ruby on Rails application using MySQL instead of SQLite
I want to create my Rails application with MySQL, because I like it so much. How can I do that in the latest version of Rails instead of the default SQLite?
View ArticleHow to deserialize boolean params.permit value correctly to make sure it's...
There are params to permit:{"string_value": "value","boolean_value": "true/false","other_value": "blabla"}I need to convert the boolean_value to Boolean like this...
View ArticleRuby / Rails - How to aggregate query results in an array?
I have a large data set that I want to clean up for the user. The data set from the DB looks something like this:ID | project_id | thread_id | action_type |description 1 | 10 | 30 | comment | yada yada...
View ArticleRuby - all permutations with any number of elements
I want to transform the array [3, 4, 8]→[3, 4, 8, 34, 38, 48, 43, 83, 84, 348, 384, 834, 843, 438, 483]I tried array.permutation but this only returns [348, 384, 834, 843, 438, 483]. Is there a clean...
View ArticleHow can I syntax highlight in rich text in rails
I am creating my first non hand held rails app. one of the features involves writing code inside of a rich text area. To highlight this code(syntax) I defaulted to making use of rouge. When I used it...
View Article