resource controller generators are missing comments
Reported by ch0wda | May 16th, 2008 @ 11:25 AM | in 1.0
When running 'merb-gen resource Model' the generated controller still has a 'destroy' action in it. I've simply removed it since it doesn't jive with REST.
I've included a patch with this ticket. I couldn't find any tests associated with generator code, so there is no accompanying tests for this patch, meaning tests on the generator itself.
ch0wda
Comments and changes to this ticket
-
Michael Klishin (antares) May 16th, 2008 @ 12:45 PM
- → Milestone changed from to 1.0
- → State changed from new to open
I can see destroy method with DELETE request method condition, and delete with GET request method condition in Behavior#resource_behaviors method.
Probably this is by design, need to investigate.
-
ch0wda May 16th, 2008 @ 01:30 PM
Just to clarify, the generated resource controller includes an extra 'destroy' method that doesn't appear to be tied to anything. I simply deleted that method from the generator template.
-
Michael Klishin (antares) August 2nd, 2008 @ 01:53 PM
- → Assigned user changed from to Jonas Nicklas
- → Tag changed from to fix generator merb-gen patch resource
-
Jonas Nicklas August 4th, 2008 @ 11:18 AM
This is actually intentional, the routing works like this:
GET /posts/5/delete => delete
DELETE /posts/5 => destroy
The intention is that 'delete' asks the user to confirm the deletion, as a fallback if JavaScript is disabled.
The solution to this is to add Rails-style comments before the actions to make it clearer what the intention is.
-
-
Jonas Nicklas August 17th, 2008 @ 04:51 PM
- → Title changed from merb-gen resource still has 'destroy' action in it to resource controller generators are missing comments
This is already fixed for the no-orm generator, and a fix for activerecord and sequel is attached.
-
Michael Klishin (antares) August 19th, 2008 @ 05:46 AM
- → State changed from open to resolved
Applied, thank you.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
