Module: CodyRobbins::HttpError::InstanceMethods
- Defined in:
- lib/cody_robbins/http_error/instance_methods.rb
Instance Method Summary collapse
-
#http_error(code) ⇒ boolean
protected
Returns the specified HTTP code in the action’s response, renders the correspondingly named HTML error document in
public, and returnsfalse.
Instance Method Details
#http_error(code) ⇒ boolean (protected)
Returns the specified HTTP code in the action’s response, renders the correspondingly named HTML error document in public, and returns false. If a corresponding HTML error document doesn’t exist, you’ll probably get some sort of exception.
28 29 30 31 32 33 |
# File 'lib/cody_robbins/http_error/instance_methods.rb', line 28 def http_error(code) render(:file => Rails.root.join('public', "#{code}.html"), :layout => false, :status => code) return(false) end |