Till the rails 2.1 version, excluding the delete action meant that the
controller will not at all respond to delete and destroy requests.
Specifically ActionController::UnknownAction was raised whenever these
actions were invoked.
In the rails 2.2 version, I am seeing a different behaviour. delete
action responds normally while the destroy action sends back some kind
of rjs (some error i guess). I do see that the record has not been
destroyed, so my data is quite safe.
Obviously, I came across this issue while upgrading to rails 2.2. I
had some tests to ensure that delete/destroy do not work even if
someone types in the appropriate url. These tests broke and thats how
I found this change.
class FooControllerTest < ActionController::TestCase
def test_delete
begin
get :delete, {:id => foos(:one).id}
flunk "Deleting should not be supported."
rescue ActionController::UnknownAction
end
end
def test_destroy
begin
get :destroy, {:id => foos(:one).id}
flunk "Destroying should not be supported."
rescue ActionController::UnknownAction
end
end
end
Any idea what was the rationale behind this change? Also do post back
if you see anything glaringly wrong with my approach.
Btw, I've already gone down the path of defining delete_authorized?
method to always return false. And that did not help my cause
either. :)
Pradeep
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---