Memoizable resource_params #216

atd opened this Issue Mar 15, 2012 · 3 comments


None yet

3 participants


The resource_params method in InheritedResources::BaseHelpers is:

def resource_params
  rparams = [params[resource_request_name] || params[resource_instance_name] || {}] 
  rparams << as_role if role_given?

A new hash is created when params is blank. However, this prevents generic manipulation of the parameters with before_filters, for example for setting the author of a post. This is because the hash is created again in build_resource

I think memoize resource_params would be valuable. What do you think?


Hey @atd. We are not maintain this project anymore (See the deprecation notice in the README). If you or anyone want to maintain it, please let us know.


I'd love to, but I can't :-(

Thanks for your work


@atd I'm resurrecting inherited_resources. You wanna create a pull request for this?

@joelmoss joelmoss pushed a commit that closed this issue Jul 2, 2012
@atd atd Memoize resource_params
Fixes #216
@joelmoss joelmoss closed this in af354db Jul 2, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment