How can an inherited view template know what the (main) instance variable name is? Is there:
- some built-in way to detect them using some magic, or;
- we roll our
own (with the controller name is the only method I can think of right
now), or; - use some generic name, or;
- ???
Rolling my own right now, but if the wheel’s already been invented…
Ok after some reading and experimentation, I found out that it has the same helpers as
inherited_resource_viewscollectionto get the collection (eg. index action)resourceto get the resource (eg. show action)And the resource(s) are still available as instance variables (eg.
@userinUsersController)