Method: Cms::ErrorHandling#with_format

Defined in:
app/controllers/cms/error_handling.rb

#with_format(format, &block) ⇒ Object

Ensures the entire render stack applies a specific format For example, this allows missing jpg’s to throw the proper error as opposed to 500



12
13
14
15
16
17
18
# File 'app/controllers/cms/error_handling.rb', line 12

def with_format(format, &block)
  old_formats = self.formats
  self.formats = [format]
  result = block.call
  self.formats = old_formats
  result
end