summaryrefslogtreecommitdiff
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
authorNicolas Braud-Santoni <nicoo@ffgraz.net>2016-08-07 16:39:42 +0200
committerNicolas Braud-Santoni <nicoo@ffgraz.net>2016-08-07 16:39:42 +0200
commitb6ca062670b342344df08b53fb216db619ef42bc (patch)
tree7680ac6b407239f6b7272c937e42f688b8de542c /app/helpers/application_helper.rb
Import legacy manman source
Copied from www.ffgraz.net
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
new file mode 100644
index 0000000..ebf937a
--- /dev/null
+++ b/app/helpers/application_helper.rb
@@ -0,0 +1,11 @@
+# Methods added to this helper will be available to all templates in the application.
+module ApplicationHelper
+ def ifnil(value=nil)
+ yield
+ rescue NoMethodError
+ raise unless $!.message =~ /:NilClass$/
+ value
+ end
+
+
+end