new UI concept (spec/progressive_enhancement.md) requires access to same
data through multiple controllers depending JS is on/off.
Example: a user is on pools index page:
- if JS is off, pools/deployments/instances lists should be loaded
from pools#index action (including all pagination/searching/permission
logic for all 3 tabs)
- if JS is on, pools#index action renders only tabpanel with tabs for
pools/deployments/instances. When the user clicks on deployments tab,
deployment list is loaded through deployments#index (same
pagination/searching/permission logic must be here)
This differs from our current concept, when both JS and non-JS requests
use same controller#action. So I wonder what is most resonable way how
to not duplicate code on multiple places.
So solution could be this:
For each tab (pools, instances, deployments) move this 'list logic' into
separate module which will be then included both in pools and 'tab'
@pools = list_pools
@instances = list_instances
@deployments = list_deployments
code for index action including perms check, pagination, search
What do you think? Anyone has some idea how to improve this?