Sometimes I check in a controller if the method is GET or POST. But afaik there are other methods - do I have to care about them?
Is the following enough?
if request.get? ... elsif request.post? ... end
Or do I have to add also an else block?
if request.get? ... elsif request.post? ... else raise "Boah!" end
IMO, defensive programming says there should almost always be an else in these type of constructs unless they're being used to prepare special cases for the code that follows (code which doesn't care if there's neither a GET nor POST).
So, what will your program do if neither of the first two are satisfied? If the code must have one or the other, then yes, you need an else. If the code modifies something in the cases of GET/POST and otherwise runs just fine if there is no GET/POST, then you do not need the else (because it would halt processing you're expecting to happen).
-- gw