338,346 questions
0
votes
0
answers
64
views
ruby koans extra credits. GREED GAME. Why do I need to pass object variable through function?
I don't know why do I have to pass @players through Game.round in function start at the end of the code, otherwise about_extra_credit.rb:145:in round': undefined method each for nil:NilClass (...
-1
votes
0
answers
56
views
ruby koan about keyword arguments [closed]
What is wrong with it ?
clean looks like that
def method_with_keyword_arguments_with_mandatory_argument(one, two: 2, three: 3)
[one, two, three]
end
def ...
0
votes
1
answer
50
views
Tailwind CSS 4.2.2 not working with Ruby on Rails 8.0.2 on old mac
I have an older mac running Mac OS Catalina 10.15. Installed ruby on rails 8.0.2 just fine, created a test app, confirmed it worked when I spun it up on the rails server (bin/rails server).
I wanted ...
0
votes
3
answers
63
views
How to provide a form field for a grandparent in Ruby-on-Rails SimpleForm?
I have 3 models in Rails, Category (grandparent) has_many Domain (parents), which has_many Url (children). Here, users can create/edit Url but not the other two; Domain model is automatically created/...
0
votes
1
answer
59
views
Why won't this custom crypto validation pass true? [closed]
I know that
AdequateCryptoAddress.valid?(:ETH_address, 'ETH')
resolves to true in the console, however,
class User < ApplicationRecord
attribute :ETH_address, :string
validates :name, ...
0
votes
0
answers
39
views
How make rails serve images referred from 3rd party css files
So I got an application based on rails (7.0.8.3)
Using bowerfile I've installed some additional js libs including jquery ui
I've included a jquery-ui css styles into my application.css by sprockets ...
0
votes
2
answers
113
views
webmock syntax for return hash
Webmock provides a suggested stub for a Rails controller action.
I have not found proper syntax required for the return body.
The request (abbreviated)
intent = Stripe::PaymentIntent.create({
amount:...
-1
votes
0
answers
35
views
rails minitest stubbing request launched within a controller action
A rails controller action prepares data for connecting to an external payment service
authorisation = (purchase.to_d * 100).to_i
@financial_transaction = FinancialTransaction.create(user_id: user.id ...
1
vote
0
answers
51
views
How Do I get the following notification to work?
I am using noticed gem on rails to create a notification method to send notification to user when he is followed by another user but I am getting error.I used a video to setup noticed.
and the ...
1
vote
0
answers
73
views
ActiveAdmin 3.3.0 DELETE actions not working with Rails 8.0.2
I'm having an issue with ActiveAdmin 3.3.0 in my Rails 8.0.2 application where DELETE actions are not working. When an admin user clicks the "Delete" link, the application performs a GET ...
-6
votes
0
answers
105
views
Excercise with dice game. looking for method
I have array containg 5 integers from 1 to 6 for example. [1,2,3,5,6]
I want to check if my array contain 3's for example if it contains [5,5,5]
I am looking for a method of array like [5,1,5,2,5]....
-1
votes
0
answers
43
views
How can I align my button with a simple_form input field [closed]
I am currently attempting to add a button which will sit in line, to the right of the case_number input field. I have tried adding a control group but the button seems to be stuck below the ...
-2
votes
0
answers
30
views
Reset the password for user 'root' on rails; database.yml; OR find how the mysql2 Gem launches mysql and follow mysql instructions [duplicate]
Problem:
I set the root password for mysql database (8.0.41) which is in use by rails application (Ruby 2.6.3) using Gem mysql2 (< 0.6.0) manually. I thought I forgot it; but it may have been ...
-1
votes
1
answer
34
views
Errno::EPERM: Operation not permitted [closed]
I was trying to run this command on console -bundle exec sidekiq after that i'm getting this error
What I've tried:
Verified Redis is running (redis-cli ping responds with "PONG")
Confirmed ...
-1
votes
0
answers
31
views
Bizarre behavior with two Devise models, where one is for ActiveAdmin [closed]
This isn't a big deal, it's just weird, so I'm curious if anybody has any insight into why it occurs.
I have a Rails app with two Devise models (User and AdminUser), the latter of which is for Active ...