Skip to content

Instantly share code, notes, and snippets.

@r38y
Created June 14, 2013 04:20
Show Gist options
  • Save r38y/5779440 to your computer and use it in GitHub Desktop.
Save r38y/5779440 to your computer and use it in GitHub Desktop.
It handles the case where there is a funky format and a template for it can't be found.
module HandleFunkyFormats
extend ActiveSupport::Concern
included do
rescue_from ActionView::MissingTemplate do
if params[:format]
redirect_to format: nil
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment