I'm a pretty new to ROR and i'm in trouble to organize my files.
I have two models: Admin and User. Also, I generated the Devise views for the both scopes.
Current I have a folder called admin and my files got a little confused after I created the admins folder.
Current files structure
controllers
├── admin
| ├── dashboard_controller.rb
| └── reports_controller.rb
|
└── admins
└── registrations_controller.rb (custom controller inherit from devise controllers)
views
├── admin
| ├── dashboard
| | ├───── new.html.erb
| | └───── edit.html.erb
| └── reports
| ├────── new.html.erb
| └────── edit.html.erb
|
└── admins
├── registrations
My routes
devise_for :admins, path: 'admin', path_names: { sign_in: 'login', sign_out: 'logout'}
authenticate :admin do
namespace :admin do
resources :dashboard, only:[:index]
end
end
In this case, what is the best approach to organize the files? Any materials to recommend me?