add support for external links
authorelijah <elijah@riseup.net>
Fri, 7 Dec 2012 19:45:48 +0000 (11:45 -0800)
committerelijah <elijah@riseup.net>
Fri, 7 Dec 2012 19:45:48 +0000 (11:45 -0800)
app/helpers/application_helper.rb

index a9a7dc9..15493e1 100644 (file)
@@ -9,10 +9,11 @@ module ApplicationHelper
   end
 
   #
-  # two forms:
+  # three forms:
   #
   #  (1) link('page-name')
   #  (2) link('label' => 'page-name')
+  #  (3) link('label' => 'https://url')
   #
   # both accept optional options hash:
   #
@@ -31,6 +32,8 @@ module ApplicationHelper
     end
     if name.starts_with?('#')
       path = name
+    elsif name.starts_with?('http')
+      path = name
     else
       page = StaticPage.find(name)
       if page