Questions tagged [ruby]
Ruby is a multi-platform open-source, dynamic object-oriented interpreted language. The [ruby] tag is for questions related to the Ruby language, including its syntax and its libraries. Ruby on Rails questions should be tagged with [ruby-on-rails].
ruby
28
questions
2
votes
0
answers
10
views
Ruby setter-methods: Is the equal-character (=) a convention or functionality?
Taken this class as a example:
class House
def initialize(color, size)
@color = color
@size = size
end
def color
@color
end
# Is the = part of the syntax or a convention?
def ...
0
votes
0
answers
11
views
Trying to install Nanoc (with Ruby) on Fedora Linux, but getting an error I can't decipher
I try to install Nanoc on Fedora Linux.
I've successfully installed Ruby using
dnf install ruby
Checked it with ruby -v and made sure rubygems is installed. Also checked version to verify ...
0
votes
0
answers
8
views
Issue with rails hotwire trix textarea resize
im trying to create a textarea resize grippie more or less like the SO for a trix textarea with rais stimulus so i set this controller below
the issue is when i pull down the textarea the textarea ...
0
votes
0
answers
20
views
Ruby with Postgresql raising NumericValueOutOfRange
I'm trying to do the following query using ruby and pqsql, but when trying a range with more than 1.000 registers I'm receiving an error.
.
.
.
user.left_outer_joins(:coverage_radius).where(id: i)....
0
votes
1
answer
50
views
Model VS Active record in ROR
Can somebody please explain me the difference between model and active record in simple words ?
Is active model and model same ?
PS: Knowledge regarding these topics will be appreciated.
I am newbie ...
0
votes
1
answer
29
views
Why can't I wrap Sidekiq.configure_server in Rails after_initialize?
After upgrade to Rails 6 the initializers/sidekiq.rb is causing deprecation warnings about class autoloading. As a workaround I thought I could wrap the contents of Sidekiq.configure_server in Rails....
5
votes
5
answers
95
views
Capturing all matches of a string value from an array of regex patterns, while prioritizing closest matches
Let's say I have an array of names, along with a regex union of them:
match_array = [/Dan/i, /Danny/i, /Daniel/i]
match_values = Regexp.union(match_array)
I'm using a regex union because the actual ...
0
votes
0
answers
38
views
Rails: problem with "@hotwired/turbo-rails" and redirects
// app/javascript/application.js
import "@hotwired/turbo-rails"
import "controllers"
import "trix"
import "@rails/actiontext"
import Rails from "@rails/ujs&...
0
votes
0
answers
25
views
Ruby debugging will not work in VSCode for any of the debuggers
I am trying to debug a ruby program and cant get the debugger to work for ANY of the debuggers. I have tried rdbg, pry-byebug, byebug and LSP. Every time I try to run the bebugger it says DEBUGGER : ...
0
votes
1
answer
34
views
Both controller level and Model level metadata simultaneously in the same column of record. how to store in PaperTrail: versions table
I'm encountering an issue with PaperTrail in my Rails application where I'm trying to store both controller-level and model-level metadata in the versions table, but only the controller-level metadata ...
0
votes
0
answers
22
views
unknow keyword: :expires_in when deploy Ruby 3.2.2 application to AWS Elastic Beanstalk
When I try to deploy Ruby 3.2.2 application to AWS Elastic Beanstalk (Platform Ruby 3.2 running on 64bit Amazon Linux 2023), I get below error:
[29074] unknown keyword: :expires_in
[29074] /var/app/...
0
votes
0
answers
20
views
Storybook Configuration with Ruby on Rails [closed]
I'm trying to follow the view_component-storybook configuration. I've replicated everything on my windows machine and the static preview pages also work. But the storybook playground doesn't render ...
0
votes
1
answer
42
views
How do I remember where user left in rails
In rails how do I remember which page user left at with user login.
When same user comes back he lands on the same page.
I am new to rails not sure how I can approach this problem.
Is there any gem to ...
0
votes
0
answers
23
views
Why Tailwind CSS doesn't works with public/*.html files in my Ruby on Rails project
I'm using Tailwind CSS for my Ruby on Rails project, the CSS works fine with all the layouts in views but it doesn't works with public/*.html files in my project.
I have a 404.html page and a 500.html ...
0
votes
0
answers
43
views
Rails: problem with handle redirect with turbo_stream in apps
In the application, when creating a feature, it was necessary to add hotwired/turbo-rails.
// app/javascript/application.js
import "@hotwired/turbo-rails"
import "controllers"
...