How to best organize a Rails app folder?

maestromac

Mac Siri

Posted on October 19, 2018

How to best organize a Rails app folder?

Aside from all the rudimentary folders, we have a few that are generated by gems we use, and then there's the custom folders we've created. It's not obvious sometime what should go where. We have folders called "labor" and "services" which are for plain-old-ruby-objects; We had some purpose to these patterns but it never really materialized. Now it's just confusing.

app
├── assets
├── controllers
├── dashboards (created by administrate gem)
├── decorators (created by draper gem)
├── fields (created by administrate gem)
├── helpers
├── javascript (created by Webpacker gem)
├── labor [** we created **]
├── lib
├── liquid_tags [** we created **]
├── mailers
├── models
├── observers [** we created **]
├── policies (created by Pundit gem)
├── sanitizers [** we created **]
├── services [** we created **]
├── uploads (created by carrierwave gem)
└── views
Enter fullscreen mode Exit fullscreen mode

Or check it out here on GitHub

How do you organize your Rails app folder? Any and all opinionated suggestion welcomed!

💖 💪 🙅 🚩
maestromac
Mac Siri

Posted on October 19, 2018

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related