Skip to content

Instantly share code, notes, and snippets.

@josemarluedke
Created February 27, 2013 03:40
Show Gist options
  • Save josemarluedke/5044835 to your computer and use it in GitHub Desktop.
Save josemarluedke/5044835 to your computer and use it in GitHub Desktop.
MonkeyPatch for Inherited Resources to works with strong parameters and rails 4.0
# MonkeyPatch for Inherited Resources to works with strong parameters and rails 4.0
module InheritedResources
module BaseHelpers
protected
def build_resource
get_resource_ivar || set_resource_ivar(end_of_association_chain.send(method_for_build, request.get? ? {} : resource_params))
end
def update_resource(object, attributes)
object.update_attributes(attributes)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment