Jan,
I think you're taking the right approach on that. Let's stick with it for now, and
I'll let you know if I have any incredibly insightful thoughts on the issue.
Cheers,
Ken
On May 26, 2011, at 12:24 PM, Jan Provazník wrote:
Hi Ken,
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'
controller.
Example:
PoolsController
include DeploymentsListing
include PoolsListing
include InstancesListing
def index
@pools = list_pools
@instances = list_instances
@deployments = list_deployments
end
end
DeploymentsController
include DeploymentsListing
def index
list
end
end
module DeploymentListing
def list_pools
code for index action including perms check, pagination, search
end
end
What do you think? Anyone has some idea how to improve this?
Jan
_______________________________________________
aeolus-devel mailing list
aeolus-devel(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/aeolus-devel