Skip to content

Eighteen versions of a web application and REST API, developed using Ruby on Rails, aim to fully leverage MVC/Rails by promoting modularization and orthogonality.

Notifications You must be signed in to change notification settings

solid-process/rails-way-app

 
 

Repository files navigation

MENU README | How to run locally | REST API doc | Web app screenshots

🚆 Rails Way App

Eighteen versions (gradually implemented) of a Web and REST API app made with Ruby on Rails that aims to get the most out of the MVC/Rails Way.

📚 Table of contents

💡 Summary

Branch031-resources-within-namespaces_base-controllers
Lines of Code1355
Rubycritic Score91.56

In the branch 021-multi-controllers-per-entity_rest_actions_only, the TaskItemsConcern was introduced to share code among the task item controllers.

However, as with the previously introduced namespaces, this version introduces the concept of base controllers to replace the concern usage. This way, the controllers within a namespace can have specific (more cohesive) parent classes.

See below how the task controllers are organized:

app/controllers/task ├── items │ ├── base_controller.rb │ ├── complete_controller.rb │ └── incomplete_controller.rb └── items_controller.rb
Task::ItemsController < Task::Items::BaseController Task::Items::CompletedController < Task::Items::BaseController Task::Items::IncompleteController < Task::Items::BaseController

🤔 What are the benefits of using base controllers?

Since the previous version, we can see that the Rubycritic score has remained the same, which is positive given that the improvements in the structure do not complicate the existing implementation.

Although the score has not changed, we can see how this grouping reduces the effort to understand and find your way around the code. This also translates into increased cohesion, not at the class level but at the namespace level (groups of classes and modules).

🔎 What the next version will have?

The cohesion ideas (organization and grouping guided to a specific purpose) will be applied to views and partials. Check out to see the benefits of this approach.

Next version: 032-resources-within-namespaces_partials-grouped-by-context.

📣 Important info

To understand the project's context, I'd like you to please read the main branch's README.

Check out the:

  1. disclaimer to understand the project's purpose.
  2. summary of all branches.

About

Eighteen versions of a web application and REST API, developed using Ruby on Rails, aim to fully leverage MVC/Rails by promoting modularization and orthogonality.

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •