Created
February 11, 2011 10:28
-
-
Save skorfmann/822178 to your computer and use it in GitHub Desktop.
force format temporary in views
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 ApplicationHelper | |
| def with_format(format, &block) | |
| old_formats = formats | |
| lookup_context.send(:_set_detail, :formats, [format]) | |
| result = capture(&block) | |
| lookup_context.send(:_set_detail, :formats, old_formats) | |
| return result | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment