Created
February 27, 2013 03:40
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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