MENUREADME | How to run locally | REST API doc | Web app screenshots
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.
| Branch | 032-resources-within-namespaces_partials-grouped-by-context |
| Lines of Code | 1355 |
| Rubycritic Score | 91.56 |
The previous version revealed the benefits of group controller within namespaces. This version will apply the same ideas to the view partials.
Let's see comparation between the previous and current structure:
| Previous | Current |
|---|---|
app/views ├── shared │ ├── settings │ │ └── _header.html.erb │ ├── tasks │ │ ├── _add_new.html.erb │ │ └── _header.html.erb │ └── users │ ├── _header.html.erb │ ├── _reset_password_link.html.erb │ ├── _sign_in_link.html.erb │ ├── _sign_up_link.html.erb │ └── user_token.json.jbuilder ├── task │ ├── items │ │ ├── _delete_action.html.erb │ │ ├── _edit_action.html.erb │ │ ├── _toggle_status_action.html.erb │ └── lists │ ├── _delete_action.html.erb │ ├── _edit_action.html.erb │ ├── _view_items_action.html.erb | app/views ├── task │ ├── items │ │ ├── actions │ │ │ ├── _delete.html.erb │ │ │ ├── _edit.html.erb │ │ │ └── _toggle_status.html.erb │ ├── lists │ │ ├── actions │ │ │ ├── _delete.html.erb │ │ │ ├── _edit.html.erb │ │ │ └── _view_items.html.erb │ └── shared │ ├── _add_new.html.erb │ └── _header.html.erb ├── user │ ├── shared │ │ ├── _header.html.erb │ │ ├── links │ │ │ ├── _reset_password.html.erb │ │ │ ├── _sign_in.html.erb │ │ │ └── _sign_up.html.erb │ │ ├── settings │ │ │ └── _header.html.erb |
To answer this, let's analyze the partials in the app/views/shared folder from the previous version. It was less cohesive because it knew all the application contexts (settings, tasks, and users).
The current version shows that these partials have been moved to task or user contexts. This change created a more cohesive structure because of the lower indirection and greater specificity of each partial's use.
Aiming increasing the cohesion of the application, the next version will move the mailer views under the entity user context.
Next version: 033-resources-within-namespaces_mailers-under-entity-context.
To understand the project's context, I'd like you to please read the main branch's README.
Check out the:
- disclaimer to understand the project's purpose.
- summary of all branches.