{"id":13878103,"url":"https://github.com/PacktPublishing/Layered-Design-for-Ruby-on-Rails-Applications","last_synced_at":"2025-07-16T14:31:22.566Z","repository":{"id":66167861,"uuid":"506518395","full_name":"PacktPublishing/Layered-Design-for-Ruby-on-Rails-Applications","owner":"PacktPublishing","description":"Layered Design for Ruby on Rails Applications, published by Packt","archived":false,"fork":false,"pushed_at":"2023-12-12T18:02:11.000Z","size":3358,"stargazers_count":216,"open_issues_count":1,"forks_count":23,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-08-07T08:09:51.278Z","etag":null,"topics":["ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PacktPublishing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-06-23T06:12:21.000Z","updated_at":"2024-08-05T21:39:08.000Z","dependencies_parsed_at":"2023-12-12T19:56:52.839Z","dependency_job_id":null,"html_url":"https://github.com/PacktPublishing/Layered-Design-for-Ruby-on-Rails-Applications","commit_stats":null,"previous_names":["packtpublishing/layered-design-for-ruby-on-rails-applications"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PacktPublishing%2FLayered-Design-for-Ruby-on-Rails-Applications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PacktPublishing%2FLayered-Design-for-Ruby-on-Rails-Applications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PacktPublishing%2FLayered-Design-for-Ruby-on-Rails-Applications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PacktPublishing%2FLayered-Design-for-Ruby-on-Rails-Applications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PacktPublishing","download_url":"https://codeload.github.com/PacktPublishing/Layered-Design-for-Ruby-on-Rails-Applications/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226138849,"owners_count":17579496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ruby","ruby-on-rails"],"created_at":"2024-08-06T08:01:39.889Z","updated_at":"2024-11-24T07:30:45.771Z","avatar_url":"https://github.com/PacktPublishing.png","language":"Ruby","readme":"# Layered Design for Ruby on Rails Applications\t\nLayered Design for Ruby on Rails Applications, published by Packt\n\n\u003ca href=\"https://www.packtpub.com/product/layered-design-for-ruby-on-rails-applications/9781801813785\"\u003e\u003cimg src=\"https://static.packt-cdn.com/products/9781801813785/cover/smaller\" alt=\"Layered Design for Ruby on Rails Applications\" height=\"256px\" align=\"right\"\u003e\u003c/a\u003e\n\nThis is the code repository for [Layered Design for Ruby on Rails Applications](https://www.packtpub.com/product/layered-design-for-ruby-on-rails-applications/9781801813785), published by Packt.\n\n**Discover practical design patterns for maintainable web applications.**\n\n## What is this book about?\nRuby on Rails is an open-source framework for building web applications from scratch and develop a full-featured product. This book helps you keep the code maintainable while working on a Rails application by demonstrating the useful design patterns and exploring the common code abstractions.\n\nThis book covers the following exciting features:\n\n* Discover Rails' core components and its request/response cycle\n* Understand Rails' convention-over-configuration principle and its impact on development\n* Explore patterns for flexibility, extensibility, and testability in Rails\n* Identify and address Rails’ anti-patterns for cleaner code\n* Implement design patterns for handling bloated models and messy views\n* Expand from mailers to multi-channel notification deliveries\n* Explore different authorization models and layers\n* Use a class-based approach to configuration in Rails\n\nIf you feel this book is for you, get your [copy](https://www.amazon.com/Layered-Design-Ruby-Rails-Applications/dp/1801813787) today!\n\n\u003ca href=\"https://www.packtpub.com/?utm_source=github\u0026utm_medium=banner\u0026utm_campaign=GitHubBanner\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/PacktPublishing/GitHub/master/GitHub.png\" \nalt=\"https://www.packtpub.com/\" border=\"5\" /\u003e\u003c/a\u003e\n\n\n## Instructions and navigations\n\nAll of the code is organized into folders. For example, Chapter02.\n\nThe `lib/` folder contains utilities to run code snippets. Most chapter folders also contain the `prelude.rb` file\nwith the environment configuration for the examples (dependecies, Rails application configuration, database schema extensions, etc).\n\nYou can run any example using the `ruby` command, for example:\n\n```sh\n$ ruby Chapter01/01-request-gc-stats.rb\n\nTotal allocations: 18573\n```\n\n### Using examples runner\n\nYou can also run examples using a specific runner scripts, which prints the source code along with intermediate\nreturn values in addition to executing the code:\n\n```sh\nruby run.rb Chapter01/01-request-gc-stats.rb\n```\n\nHere is an example output of the runner:\n\n\u003cimg src=\"./assets/demo.gif\" alt=\"Runner demo\" width=\"720px\"\u003e\n\n### Running Rails tasks\n\nYou can run Rails (Rake) tasks using the `bin/rails` executable:\n\n```sh\n$ bin/rails middleware\n\nuse ActionDispatch::HostAuthorization\nuse Rack::Sendfile\n...\nuse Rack::TempfileReaper\nrun App.routes\n```\n\nYou can also load the application modification for a particular chapter by specifying the `CHAPTER` env var:\n\n```sh\n$ CHAPTER=2 bin/rails routes\n\n...\n         books GET    /books(.:format)\n    books#index\n    categories GET    /categories(:format)\n    categories#index\n      category GET    /categories:id(.:format)\n    categories#show\n```\n\nFinally, you can run a Rails server for a particular chapter (some chapters contain controllers and views examples). For example, for Chapter 7:\n\n```sh\n$ CHAPTER=7 bin/rails rails s\n\n[2023-01-30 22:45:37] INFO  WEBrick 1.8.1\n[2023-01-30 22:45:37] INFO  ruby 3.2.0 (2022-12-25) [aarch64-linux]\n[2023-01-30 22:45:37] INFO  WEBrick::HTTPServer#start: pid=1266 port=3000\n...\n```\n\nNow you can open a web server at [localhost:3000/users](http://localhost:3000/users) and play with the auto-generated Rails CRUD interface for users.\n\n### Software and Hardware List\n\n| Chapter  |        Software required             |           OS required               |\n| -------- | ------------------------------------ | ----------------------------------- |\n| 1-15     | Ruby 3.2                             |     Any OS that runs Ruby           |\n\n### Related products \u003cOther books you may enjoy\u003e\n* Web Development with Julia and Genie  [[Packt]](https://www.packtpub.com/product/web-development-with-julia-and-genie/9781801811132) [[Amazon]](https://www.amazon.in/Development-Julia-Genie-hands-high-performance/dp/180181113X)\n\n* Practical Module development for Prestashop 8  [[Packt]](https://www.packtpub.com/product/practical-module-development-for-prestashop-8/9781837635962) [[Amazon]](https://www.amazon.in/Practical-Module-Development-Prestashop-customizable/dp/183763596X/ref=tmm_pap_swatch_0?_encoding=UTF8\u0026qid=\u0026sr=)\n\n## Get to Know the Author\n**Vladimir Dementyev** is a principal backend engineer at Evil Martians, a product development consultancy from Earth, focusing on building maintainable web applications and developers’ productivity. He is the creator of popular open source tools, such as AnyCable and TestProf, and a contributor to many other open source projects, including Ruby on Rails and Ruby itself. Vladimir plays an active role in the Ruby community through his code contributions and by speaking at conferences and sharing his passion for coding via articles and blog posts. For his contributions to the Ruby ecosystem, Vladimir was awarded the Fukuoka Ruby Award in 2021 and the Ruby Hero Russia Award in 2017.\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPacktPublishing%2FLayered-Design-for-Ruby-on-Rails-Applications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPacktPublishing%2FLayered-Design-for-Ruby-on-Rails-Applications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPacktPublishing%2FLayered-Design-for-Ruby-on-Rails-Applications/lists"}