Created
May 5, 2012 08:22
-
-
Save ccyrille/2600892 to your computer and use it in GitHub Desktop.
Helper to ignore asset pipeline exceptions when rendering images (for example, 'Sprockets::Helpers::RailsHelper::AssetPaths::AssetNotPrecompiledError')
This file contains hidden or 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
| module MyHelper | |
| def image_tag_without_exception image_name, opts = {} | |
| begin | |
| return image_tag(image_name, opts) | |
| rescue | |
| # DO NOTHING | |
| end | |
| return "" | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment