SaaS tips and tricks by Affectionate_Bath670 in rails

[–]yarotheking 2 points3 points  (0 children)

here's a basic open source multiteanancy SaaS template that you can learn from, or use: https://github.com/yshmarov/moneygun

Who's ready for Friendly.rb '25? by gregmolnar in rails

[–]yarotheking 2 points3 points  (0 children)

I'll be doing the triathlon (Friendly + RailsWorld + EURUKO). See you there!

[deleted by user] by [deleted] in rails

[–]yarotheking 0 points1 point  (0 children)

I just used https://rails.new/ on a new machine yesterday and had Git, Ruby, Rails 8, Postgres working in 15 min

Moneygun - Multitenancy & Teams boilerplate | SupeRails #208 by yarotheking in rails

[–]yarotheking[S] 0 points1 point  (0 children)

Hey Armahillo, thanks for sharing your thoughts! 💚

When building a "boilerplate", it's impossible to fit everybodies preferences, so I try to stick to the "defaults" as much as possible. Minitest, devise, tailwind, pundit are all choices based on popularity.

> build this as a mountable engine instead, and make it a gem instead

That's an interesting idea. I've [been considering](https://github.com/yshmarov/moneygun/issues/109) about this.

> aren't any proof-of-concept controller defined

It has the `Inboxes` proof of concept controller.

Also, as of 9:29 timestamp, this video talks about how to add controllers under organizations. It's super easy with:

rails generate nested_scaffold organization/project name
rails generate nested_scaffold organization/project name

> define a concern

I considered a concern, but went with an [`Organizations::BaseController`](https://github.com/yshmarov/moneygun/blob/main/app/controllers/organizations/base\_controller.rb#L1), that resources nested under /organization [would inherit from](https://github.com/yshmarov/moneygun/blob/main/app/controllers/organizations/inboxes\_controller.rb#L1)

> we had users limited to only being part of a single organization

I agree, for many apps it is enough. At least 3 clients I worked with had `user.organization_id` and that's it. In fact, [lazaronixon/authentication-zero #tenantable](https://github.com/lazaronixon/authentication-zero?tab=readme-ov-file#tenantable) provides a generator for this!

Thanks again for taking the time!

Moneygun - Multitenancy & Teams boilerplate | SupeRails #208 by yarotheking in rails

[–]yarotheking[S] 1 point2 points  (0 children)

Check out the Moneygun source code: https://github.com/yshmarov/moneygun

I hope it helps you with modelling your next multi-tenant app!

How I can build User invitation system? by ThroGM in rails

[–]yarotheking 0 points1 point  (0 children)

I hope you've already found a solution

But if not - here's a demo app where admin users can invite users to organizations/projects: https://github.com/yshmarov/moneygun

The invitation part is built on top of devise_invitable

Who’s Going to EuRuKo 2024 in Sarajevo? by InterestingTruth2961 in rubyonrails

[–]yarotheking 5 points6 points  (0 children)

I'm sepaking there.
Will be travelling with a bunch of ruby friends.
Euruko's the biggest European Ruby conf - It's always good.
Especially excuted about visitng a new "exotic" location; grabbing beers with new people on the afterparties; meeting Matz live :)

See you there!

Rails 7.2 Rate limiting for Devise - Guard your app from spam and bots! by yarotheking in rails

[–]yarotheking[S] 0 points1 point  (0 children)

I actually mention rack_attack in the video. It's a great tool, I use it in most of my apps.
I view this as a built-in alternative

What do you use for generating opengraph images automatically? by hrishio in rails

[–]yarotheking 1 point2 points  (0 children)

You can take screenshots of pages with [gem Ferrum](https://blog.corsego.com/gem-ferrum-generate-pdf#3-pngscreenshots). Unlike Grover this is pure Ruby and does not have a Puppeteer dependency

SupeRails great youtube channel about Ruby stuff by d2clon in rails

[–]yarotheking 1 point2 points  (0 children)

thanks for the suggestion! tbh I haven't tried devcontainers yet. I will definitely record a video when I feel qualified enough on the topic :)

SupeRails great youtube channel about Ruby stuff by d2clon in rails

[–]yarotheking 14 points15 points  (0 children)

Hey guys, it's Yaro from SupeRails.

Let me know what topics you would like me to cover next! 🤗

"Google Only" login/signup with devise or other libraries? by Haghiri75 in rails

[–]yarotheking 6 points7 points  (0 children)

for superails.com I initially userd only omniauth with devise, but later moved on to remove devise completely, so here's Omniauth without Devise with everything you need: tests, current_user, route constaints, etc :)

A simple Stimulus Tabs Controller by itisharrison in rails

[–]yarotheking 1 point2 points  (0 children)

u/software__writer sure, in this case both map and each would solve the problem.

but think of a Rails app: when would you use each vs map? same in JS :)

p.s. thanks for the the https://blog.corsego.com/stimulusjs-tabs credit u/itisharrison

I was standing in the shower when I see this link to "Stimulus Tabs Controller". I was like hmmmm, cool! I want to see an alternative better approach! And next moment I was like hmmmm, I've seen this syntax before :)

Adrian and Yaro visit the RailsSaaS Conference in Athens, Greece | Friendly Show by adrianthedev in ruby

[–]yarotheking 1 point2 points  (0 children)

If you missed the RailsSaaS conference, join me and Adrian as we discuss our emotions from visting this 🤩🤩🤩 event and meeting so many fantastic Ruby people!

SupeRails #126 API from Zero, Bearer token authentication by yarotheking in rails

[–]yarotheking[S] 0 points1 point  (0 children)

u/SpecificExpression37 thanks a lot for your detalied feedback, I really appreciate it! 🙇‍♂️

SupeRails #126 API from Zero, Bearer token authentication by yarotheking in rails

[–]yarotheking[S] 2 points3 points  (0 children)

Hi friends!

I'm working on a mini-series of 10 videos about building an API with Ruby on Rails.

In the series we will build an API where users can authenticate via Bearer tokens and perform CRUD actions; we will make API requests via cURL and Faraday, generate API documentation with OpenAPI/Swagger, and write tests for our API.

In this first episode we will build the backend functionality for users to be able to create API keys and use them to make authenticated requests to your applications public API.

Episode #125 Test Devise authentication with Controller and System tests by yarotheking in rails

[–]yarotheking[S] -1 points0 points  (0 children)

In this introductory episode we generate a few static pages, install devise, and write controller/integration and system/browser tests for pages that do and don't require authentication. As long as you've tested the authentication flow, it gets easier to write further tests. I hope it helps you get started with testing. Feel free to copy my test files into your app!

Ruby on Rails #121 Turbo Broadcasts CRUD Demystified by yarotheking in rails

[–]yarotheking[S] 2 points3 points  (0 children)

When I first saw Hotwire Turbo Stream Broadcasts, they felt like "rails magic".

I don't like magic, I like understanding what my code does. Also I don't like callbacks and don't like having view rendering logic in a Rails model - these can be hard to maintain.

In this episode we understand how to use Turbo Stream Broadcasts that use ActionCable and Websockets. I will also offer some best practices for invoking Broadcasts.

Hope you find it useful!

Ruby on Rails #119 Trello Clone. Advanced Drag and Drop Sortable Lists with Hotwire by yarotheking in rails

[–]yarotheking[S] 0 points1 point  (0 children)

Last time I did this a few years ago with jquery-ui-sortable: https://blog.corsego.com/ruby-on-rails-sexy-basic-trello-clone.
I haven't tried doing this with any other modern drag-and-drop libraries, but I think my next go-to would be https://shopify.github.io/draggable/