Created
February 11, 2011 23:17
-
-
Save purplejacket/823254 to your computer and use it in GitHub Desktop.
attempt at returning a 500 error if the params hash has a nil value
This file contains 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
# Is this the proper way to detect whether any of the params has a nil value? | |
# I think it's being superseded by the before_filter because I see | |
# /Users/kaimiddleton/Sites/thundercat/vendor/plugins/fixie_whitelister/lib/white_list_helper.rb:34:in `strip_naughty_stuff' | |
# when I hit the browser with, say, http://localhost:3000/?/ | |
class MainController < ApplicationController | |
skip_before_filter :require_restrictive_access | |
before_filter :main_sidebar, :only => [:index, :landing_page] | |
def index | |
if params.has_value? nil | |
render :status => 500 | |
return | |
end | |
# ... | |
end | |
# ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment