Questions tagged [ruby-on-rails]
Ruby on Rails is an open-source web development framework written in Ruby. If your question code is written in Ruby on Rails, tag with Ruby as the language tag. Many things are defined by convention, freeing you from having to re-invent things to stay productive.
580 questions
3votes
0answers
41views
Using Pundit Policy Scopes with Searchkick Results
We are using Searchkick to run our elasticsearch and Pundit to authorize users for specific actions. Below is our module SearchkickScope that does it's best to ...
1vote
1answer
58views
Rails session after migrate from PHP (improved)
previusly I make a post for Session Logic for User Verification in Rails Migration. Now the improvement version following advice of the comments is here. The problem was the use of `` for executing in ...
3votes
1answer
90views
Session Logic for User Verification in Rails Migration
This is a logic to create sessions on RoR 7.1.2 based on the last version of the website which was in vanilla PHP, with the upgrade I have to deal with the users that were already signed up but not ...
2votes
2answers
184views
Ruby SFTP client
I'm on Ruby for three weeks and now I want to learn more. Please review this SFTP client and suggest any necessary changes. ...
0votes
2answers
256views
Ruby on Rails _form implicit partial test with RSpec
I am working with: ruby 3.0.0p0 and Rails 7.0.4 and rspec-rails (6.0.1) I want to test my views. I created Product model with rails scaffolding. I tested all views but I am not sure about _form.html....
0votes
1answer
68views
Find items by their properties
Given a map of items to their attributes: ...
2votes
1answer
99views
FizzBuzz solved by neural network
I wrote a very simple AI in C and connected it to the web through Ruby on Rails. It learns the fizzbuzz problem. I'm writing this because I'm back on the job market after 20 years. Of course, ...
1vote
1answer
203views
Open a file, with a fallback path if it doesn't exist at one location
I am parsing a file that exists in either app/components/ui or in app/components. If the one in the first dir (...
4votes
2answers
141views
Ruby CLI TicTacToe
I have done Tictactoe game in Ruby. It is my first Object Oriented project in Ruby. I would like to separate all program into a few classes such as Player Board and Game. I want to use more OOP best ...
1vote
1answer
38views
Optimize Tests in Rails6 - Minitest - Factory
I finally got this working but I am concerned I am being 'too' specific in my tests, and also that I am repeating myself a significant amount. I could also combine all of the failures into a single ...
1vote
1answer
124views
Rails controller to handle offers and payments for rental housing
I've been adding stuff a bit "blindly" to my controller and currently everything is working as it should, but the controller is gotten very messy. I'm using the gem ...
1vote
1answer
168views
User registration API
Would love some feedback on this simple API implementation with Ruby on Rails. Have I used proper naming conventions, readable/manageable code, optimal approaches, etc? As I'm still learning Ruby on ...
3votes
1answer
92views
Migration in a bioinformatics application that changes a column name and explains the rationale
This very short piece of code is a migration in which a column name is changed to be more descriptive. It is part of a larger bioinformatics application written in RoR that parses the output of ...
1vote
2answers
255views
Refactoring Ruby recharge REST API wrapper by using class variables
I am trying to create an API wrapper for recharge (A Shopify subscription service), I am using the HTTParty gem ...
1vote
2answers
83views
Querying and rendering an HTML table of ISP performance statistics
I have multiples measurements and I want to render it into tables like this Measurements Operator browsings FTP DL FTP UL Location Event Date Operator avg min max avg min max avg min max Verizon ...