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
229,186
questions
-1
votes
0
answers
26
views
Why is the data in a Rails view displaying as 0.0 or 42.0 instead of $42.00?
Question Title: Why is the data in a Rails view displaying as 0.0 or 42.0 instead of $42.00?
Summary: How can I get this field to display e.g. $42.00 instead of 0.0 or 42.0? In addition to the ...
0
votes
0
answers
15
views
Issue with Psych::DisallowedClass Exception when using reify in PaperTrail with Sinatra
I am working on a Ruby project using Sinatra version 3.0.6 and Ruby version 3.0.0. I am using the PaperTrail gem (version 15.1.0) to track changes in my models for auditing and version control ...
0
votes
0
answers
37
views
Ruby case examples, consistently only shows one action under when [closed]
I've waded through multitudes of Ruby case questions, here and on the web. They all have one thing in common, they only show one statement following the when. Of the form,
case whatever, simple, ...
1
vote
1
answer
46
views
Ruby module is not an ancestor after prepend
I'm developing a plugin to the Rails (6.1.7) project Foreman (v3.5.1; based on the Foreman Plugin Template) and face the issue that one of my modules (DnsInterfaceExtensions) ought to be prepended to ...
0
votes
0
answers
36
views
How can I fix Postgres errors in Minitest?
I am using Minitest and Postgres to test my Rails website. When I added a "Like" model, I started getting Postgresql deadlock errors
Minitest::UnexpectedError: ActiveRecord::Deadlocked: PG::...
0
votes
0
answers
142
views
Can I download a old version of google chrome stable? [closed]
I use the below config file in the .ebextensions to preinstall the Google Chrome stable when deploying our Ruby application to AWS EB.
commands:
01-install:
command: rpm -q google-chrome-...
0
votes
0
answers
26
views
Issue with 'libgmp-10.dll' in Ruby while compaling script with Ocra
I'm having an issue while trying to create an executable with ocra in Ruby and I'm not able to fix it no matter what, even chatGPT couldn't help.
The issue is with libgmp-10.dll. The compiler works ...
0
votes
0
answers
31
views
finding the appropriate session for an IdP single logout request with Ruby SAML
I'm putting together a gem for our Rails apps to use SAML single sign-on/logout via Entra ID. I had some questions about the final bit I need to implement: ID provider initiated single logout requests....
1
vote
1
answer
92
views
How to set view context in Rails?
I’m building a gem that intercepts Rails’ default render behavior. Instead of rendering a view, it looks for a helper method that corresponds to the current controller’s action name; it then uses the ...
0
votes
0
answers
33
views
How to remap exceptions with Grape?
In a Ruby project using Grape, I have a custom exception Api::Exceptions::InvalidValueError that subclasses Grape::Exceptions::Base. If a validation fails (which causes Grape::Exceptions::...
0
votes
2
answers
74
views
How can I update how ActiveRecord::Base#where interprets ranges?
It appears that ActiveRecord::Base#where partially distinguishes between ranges defined with 2 dots (0..) and ranges defined with 3 dots (0...).
E.g.
> User.where(id: ..0).to_sql
=> "SELECT ...
0
votes
3
answers
66
views
authentication from scartch in rails
Hi i am learning rails from the Odin project and i am creating a simple authentication without using devise . the course doesn't really give enough info to help beginners finish that project
so, Here ...
1
vote
1
answer
42
views
Rails form_with-helper: What is a :scope?
I'm currently reading the Ruby on Raily API-documentation. Specific the part about the form_with helper: https://api.rubyonrails.org/v5.1.7/classes/ActionView/Helpers/FormHelper.html#method-i-...
1
vote
5
answers
156
views
In Ruby, how do I find a value in an array of hashes?
I am trying to get a value in an array of hashes in Ruby. Given the following information below:
# array_of_hash_objects will look something like this:
# [
# { name: 'Ruby', is_my_favorite?: ...
0
votes
1
answer
86
views
Rails 7 error during application start - Zeitwerk-related errors
I'm upgrading my rails app from 6.1 to 7.0 and i'm running into this runtime error:
I do use the Authlogic gem, but the odd thing is i have no config/initializers file for Authlogic, and i can't find ...