Hello again,
Yes indeed: given current resource reflect enclosing resource and tell
if it singleton or not. Need arose when I was programing admin
interfaces and in the view I want to give link back not only to
specific enclosing resource but also to list of enclosing resources
that is enclosing resource controller 'index' action. But current
resource can be enclosed either by singleton or normal resource. If I
use 'enclosing_resources_path' helper it gives an error when enclosing
resource is singleton - given method does not exist.
When I wrote this explanation some thoughts came out:
We need some way to know which controller is responsible for that
resource and then check respond_to?(:index), or even user
resource_controller specification. But this relationship could be
easily obtained for standard cases: User model - UserControler, but
what about custom naming or other cases?
Any other thoughts?
Valdas