4 ms·
I assume the correct pattern for finite possible inputs would be something like if request.post? || request.put? || more... # do dangerous thing els
by adverbly 7y ago
I assume the correct pattern for finite possible inputs would be something like
if request.post? || request.put? || more...
# do dangerous thing
else
# do safe thing
This of course ignores the smell which others have pointed out where with rails you would ideally have a totally different method get called in the first place for a GET vs a POST as you can have different actions for them in the controller.