Sorting an array of objects in Ruby by object attribute?

4
General
Hi guys, I have an array of objects in [Ruby on Rails](https://mindmajix.com/ruby-on-rails-training). I want to sort the array by an attribute of the object. Is it possible?
Beatrice assiana replied

Deploying The Domain Monitor App To Production With Kamal Discussion

3
General
Super useful lesson. I think many of us would like to see the process of deploying to production with Postgres as the database.
Lucas Barker replied

How to Debug Ubuntu and Debian Packages Discussion

3
General
Get ready for epic drifts Drift Boss and dramatic car flips that you won't find in any other game!
Henny Diani replied

Installing ruby_opencv gem results in cannot find opencv_contrib error

12
Gems / Libraries
I am trying to install the ruby_opencv gem but it can't find opencv_contrib. I used the command 'gem install ruby-opencv -- --with-opencv-dir=/mnt/c/Users/wjones/sites/musclesound-rails/opencv/my_b...
Edward Clark replied

How to Optimize ActiveRecord Queries with Large Data Sets in Rails 7?

6
General
I'm working with a large dataset in Rails 7 and some of my Active Record queries are getting slow. I've tried using .includes and .select, but performance still lags. What are the best practices fo...
Patrick Stevenson replied

Creating New Blog Posts Discussion

1
General
Hi! I don't understand why we must instantiate a BlogPost object in the `new` function, if we are also doing so in the `create` function. It is also not clear to me how did we map the <%= form....
Bradford Gesen replied

Rails World 2023: Powerful Rails Features You Might Not Know Talk Slides Discussion

3
General
I can't wait for the video of your conf !
Bradford Gesen replied

Asset Pipeline

2
General
What are some excellent resources to get a good foundational understanding of asset pipeline, esbuild, import maps, js bundling. I have a decent knowledge of Rails, but I have trouble understanding...
Francisco Holcomb replied

Black Friday 2025 Sale Discussion

2
General
Who managed to buy something?
stres sguide replied

Reverse Proxy with Caddy and Custom (Dynamic) Domain Names

5
Servers
TL;DR - how do I override the base_url (akin to CSRF protection?) with a set of valid domains? Hi all I run a PaaS of sorts which at present is hosted on Heroku and I have to map all my custom do...
Kim Shay replied
Solved

Rails Application Templates Discussion

39
General
Hello,Im gettingCould not find "Procfile" in any of your source paths. Your current source paths are: /Users/my_user/Documents/dev/my_app/https:/raw.githubusercontent.com/excid3/jumpstart/masterUsi...
Ryan Girton replied

Custom Rails Configuration Options Discussion

2
General
Thanks for this episode, very interesting topic.
Ryan Girton replied

Displaying search results from an API

1
Rails
I am working on a small project where users can search through an API (https://github.com/games-directory/api-giantbomb) via a search bar. However, nothing is displaying on my index page with the r...
Charles Barrett replied

Ruby on Rails 3 Tutorial Book Question

3
General
Im following the PDF version of this book and keep having an issue with different versions of gems being compatible. I had to skip the TDD section all together because I couldnt get a compatible ve...
ScottLDanielson replied

Syncing Repositories with Ruby Scripts - Part 1 Discussion

7
General
Nice tutorial. Why git fetch followed by git pull and not just a single git pull?

Rails 8.1 Local CI Discussion

3
General
I found the default local CI to be a bit basic. One of my projects is a platform and when we run CI we have to run the test suite multiple times for each implementation of the platform, and we leve...
Richard Ryan replied

How Do Show Loading Indicator On A Turbo(Stimulus) Form ?

8
Ruby
I am learning rails by building a project. I am using the turbo frames for the form. I would like to add a loading indicator to the submit button just like the one on this forum when you comment on...
sarahcarter replied
Solved

How to read EDI (electronic data interchange) Format in rails

2
Rails
Hi Chris, Please help me, How to read edi format in rails. I am trying to do to googling for that solution but I didn't get any best solution If you have any idea about that, How to read and write...

How do I fix Github Action test error caused by "DevToolsActivePort file doesn't exist"?

1
Testing
Hey - I have a Github Action test file as below. When I run the CI, the system tests which use Selenium WebDriver do not pass. The following error occurs: ``` Selenium::WebDriver::Error::UnknownE...

When pre/eager loading an association, is there any way to get the associated data from a cache?

3
Rails
``` class Category < ActiveRecord::Base # columns: name has_many :books end class Book < ActiveRecord::Base # columns: title, category_id belongs_to :category end ``` Given the abov...
xiwog82932 replied

Learning Ruby on Rails? Join our newsletter.

We won't send you spam. Unsubscribe at any time.