Re:Why don't I metaprogram more?
by stevepike on Thursday August 14, 2014 @09:36PM
(#8180664)
The CanCan ruby authorization library does a neat bit of metaprogramming. It offers a function "load_resource" which you put at the top of your controller. The function uses the name of the controller class and the name of the currently executing controller action to automatically set a resource. It looks like this:
[ Parent
| on HN ]
There are no comments on this comment yet.