diff options
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index dafeb14..778d8f6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -135,4 +135,14 @@ module ApplicationHelper content_tag("h2", content, :class => "boxtitle") end + + def with_format(format, &block) + old_formats = formats + begin + self.formats = [format] + return block.call + ensure + self.formats = old_formats + end + end end |