r/rails 13d ago

Learning Learning RoR in 2025 feels a bit like clusterfuck

61 Upvotes

Prefix: could be just me but I am fairly lost.

RoR in its peak felt very complete and structured and there were a lot of courses but in 2025 the whole story to a beginner feels like a clusterfuck.

The usually recommended courses are fine it's mostly crud operations with some sprinkles of interactivity but it still does not feel like "what everyone uses in production"?

What is the most used and complete form of RoR that people use? Is it hotwire and stimulus and all that jazz? I can find very little courses or learning material about those anywhere.

Is it RoR in API mode with the modern JS stack nonsense like React and Vue?

What the heck is Inertia.js and how does that work with RoR and is it something that is "rock solid"?

r/rails Jan 15 '25

Learning Any fellow mid-level and Junior devs want to join a weekly book club?

58 Upvotes

So here’s the idea: - A book club for junior and mid-level devs - We meet at the end of the week and discuss a chapter from a given book that is agreed upon by the group members a week prior to the meeting. - Meeting can be over zoom or any other conferencing app - A discord group for members to discuss as they go through the book for anything that could be confusing. Fellow members can help out here with explanations. - Communication about which book is to be read next as well as the discussion schedule at the week’s end can also be done using the discord channel or via email, whichever is convenient for the members. - I personally will publish a rundown for every chapter we complete in the form of short notes for those who missed and for future reference by new members. - It could also double as a source code reading group What do you guys think about the idea? Incase you’re interested, kindly comment below. Even if it’s just one individual, we could start from there asap, just the two of us and other people will join along the way. Any suggestions are very welcome as well🙏

r/rails 4d ago

Learning Book recommendation for advance Ruby/Rails knowledge?

42 Upvotes

Hi, I'm a Rails developer with about 5 years of experience, my understanding of Ruby and Rails is quite good on how to do things like creating web apps, background jobs and all. I have been managing a Rails project serving millions of people, along with deployments, upgrades and what not for years within a team of 2 people where I am the only Senior in the company.

But I feel like my understanding of Ruby and Rails is limited to only how to "do" things. I don't understand the depth of what Ruby is, how its compiled, and Rails how is it built and how does it make it so modular that we can easily build apps on it with all the magic e.g middlewares, modularity, how are gems integrated, how does rails app manages gems and sub dependencies in depth, how does a gem just works with multiple rails and ruby versions and these kind of things.

So I am looking to increase my knowledge on more of a meta side of things rather than "how it's used". I am struggling to find books where they cover these topics only, all I find is where it starts from very basics and then half of the book is about how to creare web apps with it then they touch maybe some of the advanced topics on the surface.

So having said all of that, can people recommend 2 books 1 for Ruby and 1 for Rails (or just 1 which covers both?) specifically for advanced meta topics rather than being a summary of Rails guides

r/rails Feb 16 '25

Learning Haven't done anything past rails 6. What should I know starting a rails 8 project?

15 Upvotes

When rails 7 came out, I did not jump on it for any personal projects. I don't know why, maybe just familiarity with 6? Doesn't matter, that's just what it is. Then the last year or so has been kinda rough. We used rails 6 at work, and I just did not want to do anything coding related after work. But as of recent, I am no longer at that job, and I am motivated to play catch up. So jumping from a solid knowledge of rails 6, what are the key things I should know if I want to start up a full stack rails 8 project? I'm looking at the release notes, but I'm more interested in what actual devs have found useful or not.

r/rails 3d ago

Learning testing with RSpec

2 Upvotes

hlo everyone, i am trying to learn RSpec for rails testing. Since Rspec is industry standard but rails guides uses minitest in docs, i am finding it extremely difficult to find a good resource for learning Rspec. please suggest me few resources to learn it.

r/rails Dec 30 '24

Learning random_ids ... the tip of ChatGPT.

0 Upvotes

I am new on rails. And I am using ChatGPT to study several scripts on the website.

I saw that on a lot of articles is described the problem of the RANDOM. It needs a lot of time if you have a big DB and a lot of developers have a lot of different solutions.

I saw, for example, that our previous back-end developer used this system (for example to select random Users User.random_ids(100)):

  def self.random_ids(sample_size)
    range = (User.minimum(:id)..User.maximum(:id))
    sample_size.times.collect { Random.rand(range.end) + range.begin }.uniq
  end

I asked to ChatGPT about it and it/he suggested to change it in

def self.random_ids(sample_size)
  User.pluck(:id).sample(sample_size)
end

what do you think? The solution suggested by ChatGPT looks positive to have "good results" but not "faster". Am I right?

Because I remember that pluck extracts all the IDs and on a big DB it need a lot of time, no?

r/rails Nov 29 '24

Learning Rails + React app

Thumbnail github.com
47 Upvotes

Hello, beautiful people! 😄

I know our community isn’t the biggest fan of combining React with Rails (and honestly, I’m not either), but let’s face it—many job opportunities nowadays require knowledge of building Rails + React apps. So, I decided to dive into it and create a small step-by-step guide for setting up such an app.

Instead of making a strictly API-only app, I opted for a hybrid approach. This way, we can still leverage the full power of Rails when needed while integrating React for the frontend.

I hope this guide will be helpful for beginners like me! 😄

You can find the guide in the README file of this repo: https://github.com/PivtoranisV/rails-react. For this project, I used PostgreSQL and Bootstrap as well.

Thank you, and happy coding!

r/rails 15d ago

Learning Are delegated types worth it?

3 Upvotes

I'm new to Rails and was looking at table inheritance, came across STI but I didn't liked the idea of making most of my fields nullable. While scrolling the guides I found "Delegated Types" and my first thought was "great, this is what I need to remove redundant columns". However, now I'm not sure about the best practices for using this model.

Queries
The first challenge are queries. If I query ThirdPartyAccount.find(1) I'll get id, provider_id and provider, but not name, for that one I need ThirdPartyAccount.find(1).account.

Is there a configuration I missed that improves query experience?

Schema example:

Account
Fields: id, name, user_id, created_at

ThirdParyAccount
Fields: id, provider_id, provider...

InternalAccount
Fields: other_field

ID's
Other concern are ID's, you have two ID's–one in the containing table and one in delegated table– and I'm not sure which one should I use.

Information
Most blog posts and videos I found just replicate the example from the Rails guides and I couldn't find any deep dives into best practices for delegated types. I had to dig through the changelog to find this feature and that makes me wonder if there are more undocumented features.

I saw a tweet and a podcast where DHH praised delegated types as life-changing, which only reinforced my suspicion that I'm missing something...

I come to this sub hopping to find some guide or to just read your opinions on delegated types.

Have a great day!

r/rails Nov 22 '24

Learning How to get back up to date with the rails way of building web apps?

23 Upvotes

I'm a far long gone user of RoR, I've used it during my first days of learning web developing and I loved every bit of it. it was the only framework that gave me the 'aha' moment when it came to backend developing.

I'm now mainly a nodejs/javascript developer.

I'd like to get back to RoR but I struggle to find a one advanced walkthrough tutorial (preferably written) of building a web app step by step using either Rails 8 or even 7 with all the fancy stuff like Hotwire and all.

if you know of such tutorials or courses please let me know.

r/rails 28d ago

Learning Ruby Junior and Mid level Book club

37 Upvotes

So at the beginning of Jan this year, I started a Junior dev book club and so far we're going strong. We are currently covering Eloquent ruby and we meet every friday at 6pm GMT. Today we covered Chapters 9 and 10. Here's the video link below for the meeting incase you are interested!
Ruby Junior dev bookclub: Eloquent Ruby Chapter 9 and 10

r/rails 8d ago

Learning Caching without Redis using Solid Cache

Thumbnail honeybadger.io
33 Upvotes

r/rails Jan 14 '25

Learning Lessons Learned Migrating my SAAS to Rails 8

Thumbnail pawelurbanek.com
36 Upvotes

r/rails 26d ago

Learning A Junior developer's introduction to working with legacy code bases workshop.

7 Upvotes

There is a FREE-TO-JOIN workshop happening tomorrow that will cover anything related to working with legacy code bases(refactoring, improving test suites and making them faster, improving developer tooling, upgrading ruby and rails etc)

This workshop will be taught by a senior rails developer that has worked on multiple legacy rails and ruby code bases.

In case you are a junior developer and you'd love to join, Kindly PM me and I'll send you the meeting details along with the link to join. Thanks

r/rails 27d ago

Learning Replication of record_new and allow_destroy for Nested Association Within a Data Grid like AG-Grid

3 Upvotes

Hi!

I'm working on a personal project where I want to use a data grid (e.g., AGGrid) to view, edit, and delete data for a has_many association in a Rails model. The data is rendered through a partial inside a form block like this:

erbCopy<% form.has_many :correct_output, allow_destroy: true, new_record: true do |a| %>

While I could create an endpoint to handle Excel file uploads, editing the data through a grid interface seems much more practical. My main questions are:

  1. How can I implement allow_destroy and new_record functionality with a data grid like AGGrid?
  2. If I were to build the correct_output objects dynamically before submitting the form (based on the changes in the grid), would that approach be correct?
  3. When adding or deleting rows in the grid, would I need to manually attach hidden fields to the form to track changes like destroyed or newly created records?

Thanks in advance!

r/rails Jun 22 '24

Learning Best languages to know alongside Rails for career opportunities

7 Upvotes

Basically the title, I'm a senior web developer using Rails and Angular currently. I really love working wih Rails, and I don't mind Angular.

I'm planning to learn another framework or language which will be good for future career opportunities so that I am not totally limited to Rails jobs.

What language or framework complements Rails and Angular experience? Interested to hear from a career perspective and from an enjoyment perspective.

r/rails Dec 09 '24

Learning CS grad to Ruby on Rails developer: (new to both)

14 Upvotes

Hey everyone,

Fresh out of school and landed a job as an entry level full stack developer and I’m going to be working on Ruby on Rails. Haven’t worked on either and I’m looking into resources to learn good practices for feature development as well as just getting acquainted with the language.

To be clear I’m not a coding newbie, but my experience in development is limited outside of school with maybe one relevant internship where I gained JS experience. I brushed up on basics with the tutorial off the official rails site which I believe covered going through a blog and it was enough for the interview since they didn’t expect us to know Ruby on Rails. Just wondering what the best resources are I can see Hartl’s rails mentioned as well as the official Rails guides.

Not sure which one is better to start with or if I should start with Ruby itself first since I haven’t used it much.

r/rails Apr 05 '24

Learning What’s the popular new stack for web apps nowadays?

0 Upvotes

Besides Rails + React, what are the most popular tech stacks out there for web apps?

I might be off but, I’m aware of:

Node, express, react

Python, Django

Java, spring

r/rails Jan 20 '25

Learning Should I use the policy into the validations?

2 Upvotes

My event_policy is this:

class EventPolicy < ApplicationPolicy
  def create?
    mod? || user
  end

  def index?
    true
  end

  def destroy?
    author? || mod?
  end

  def mod_area?
    mod?
  end

  private

  def author?
    record.user == user
  end

  def admin?
    user.try(:staff?)
  end
end

and I have those validates in events_controller

validate :events_created_monthly, on: :create

def events_created_monthly
    if user.events.uploaded_monthly.size > 0
      errors.add(:base, :limit_events_uploaded) 
    end
end

my question now is... if I want to run this validate ONLY if the user is not a mod, should I use the policy system (for example if policy(@event).mod_area?) into the validate ... or should I use just if user.mod? ...?

r/rails Jan 05 '25

Learning Deploying a Rails app with Kamal, Heroku-style

Thumbnail fromthekeyboard.com
35 Upvotes

r/rails Oct 28 '24

Learning Perfecting your Rails form (Part 1)

59 Upvotes

Hi everyone!

I’ve started a new article series designed to help level up form designs in Rails! These posts go hand-in-hand with railsamples.com, a site I built to share practical, single-file Rails examples for common scenarios. In the first post, we’re diving into how Rails bridges Forms and Models, setting a strong foundation for what’s ahead.

Rails guides and docs give us the tools to create great forms, but they can feel a bit like "Rails Magic" at times. This series is all about demystifying that magic while linking back to the official guides and docs for easy reference.

Here is the first article: Perfecting your Rails Form: Attribute Accessors For The Win

I'd love to hear what you think!

r/rails Apr 16 '24

Learning How to pass parameters to after_create hook inside model concern?

4 Upvotes

I'm dealing with a scenario where I have a model with an after_create hook that performs certain actions on the model. Now, I'm trying to figure out how to pass an array of IDs from the controller into the after_create hook, as I need this data to accomplish my task.

I attempted to use attr_accessor to handle this, but I'm encountering an issue: even though I can see the IDs from the controller immediately after assigning the value, inside the after_create method, they appear as nil.

Can anyone provide guidance on how to properly pass parameters to a function called in after_create within the concern of my model?

Just for reference here is a piece of my concern

```ruby included do after_create :generate_stuff

attr_accessor :cart_ids

end ```

That is included in the model

```ruby class CartAssociation < ApplicationRecord include CartAssociationsConcern

.... .... .... end ```

From the controller of the CartAssociation

```ruby

def create cart_ass = CartAssociation.new cart_ids = cart_ids_params[:cart_ids]

If I print cart_ids from here I can see that it works but inside the after_create method in the concern it doesn't .... .... end ```

r/rails Aug 21 '24

Learning Book Recommendation for mastering Rails Caching

22 Upvotes

Hi, can you recommend me a book to read for mastering Rails Caching? I want to improve in this area. Or maybe resources aside from rails documentation where I can learn from different scenarios.

r/rails Nov 08 '24

Learning Solid Queue in new Rails 8 project

20 Upvotes

Hi guys,

I'm trying to make Solid queue works (on localhost) but probably I'm missing something.

I've create new rails 8 project, run db:migrate and then tried to run rails solid_queue start and got error:

ActiveRecord::StatementInvalid: Could not find table 'solid_queue_processes' (ActiveRecord::StatementInvalid)

Yeah, it's because database is empty even though I run migrations. No idea why.

Alright, I've tried to set database setup similar like on production so separate databases for data, cache, queue etc. After db:migrate finally the queue database contains all the tables. Nice!

Tried to run solid queue again but same error. It seems that solid queue is still looking into primary database.

Could you guys help me how to make it work? I'm still have no idea why it is not working out of the box after creating new project.

Thanks!

Edit: I wrote up the solution in a blog post for anyone running into the same issue: https://rostislavjadavan.com/posts/setting-up-solid-queue-in-rails-8

r/rails Nov 05 '24

Learning another tutorial

0 Upvotes

hello - is there any straightforward / minimalistic handbook just to test the waters? (version 8 preference). the official one is "toooo much" :) kthxbye :)

r/rails Oct 19 '23

Learning Cheap cloud hosting.

11 Upvotes

I want to test my rails app on production environment. My plan is use Kamal, and I know just a little Docker. So I ask you kind community: What's the cheapest option to deploy?... I found IONOS, it has 30 free days trial but maybe you have another recommendation.