CommunityNews

CommunityNews

How I organize my Rails apps

Influenced by the experiences I’ve had last ten years of building and maintaining Rails applications, combined with my experiences using other technologies, I’ve developed some ways of structuring Rails applications that have worked out pretty well for me.

Some of my organizational tactics follow conventional wisdom, like keeping controllers thin. Other of my tactics are ones I haven’t really seen in others’ applications but wish I would.

Here’s an overview of the topics I touch on in this post.

  • Controllers
  • Namespaces
  • Models
  • The lib folder
  • Concerns
  • Background jobs
  • JavaScript
  • Tests
  • Service objects
  • How I think about Rails code organization in general

Let’s start with controllers…

Read in full here:

This thread was posted by one of our members via one of our news source trackers.

First Post!

bot

bot

Corresponding tweet for this thread:

Share link for this tweet.

Popular Backend topics Top

PragmaticBookshelf
Real-time applications come with real challenges—persistent connections, multi-server deployment, and strict performance requirements are...
New
PragmaticBookshelf
Elixir and OTP provide exceptional tools to build rock-solid back-end applications that scale. Build a web application in a radically dif...
New
AstonJ
Currently a hot topic in the BEAM world, let’s start a thread for it (as suggested by @crowdhailer here) :smiley: What are your current...
New
pillaiindu
Cross posting from HashNode. A friend of mine is creating Uber-like app for a small company with 200 to 1000 cars. The app will operate ...
New
DevotionGeo
I know that -t flag is used along with -i flag for getting an interactive shell. But I cannot digest what the man page for docker run com...
New
First poster: bot
Node.js v12.20.0, v15.3.0 and v14.15.1 has been released. Link: Release 2020-11-24, Version 12.20.0 'Erbium' (LTS), @mylesborins · node...
New
PragmaticBookshelf
It's easier to learn how to program a computer than it has ever been before. Now everyone can learn to write programs for themselves—no p...
New
mafinar
I did not add this to a “this weekend I’ll learn” like my few other journals as I am decided on using this in the long term. Last I work...
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
ManningBooks
Effectively reading and understanding existing code is a developer’s superpower. In this book, you’ll master techniques for code profilin...
New

Other popular topics Top

New
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
Rainer
Not sure if following fits exactly this thread, or if we should have a hobby thread… For many years I’m designing and building model air...
New
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
New
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
First poster: joeb
The File System Access API with Origin Private File System. WebKit supports new API that makes it possible for web apps to create, open,...
New
New
PragmaticBookshelf
Author Spotlight: VM Brasseur @vmbrasseur We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New