From 01acd4bb0126080bdb58b616765fe40a7df571e9 Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 7 Dec 2012 11:45:48 -0800 Subject: add support for external links --- app/helpers/application_helper.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a9a7dc9..15493e1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 -- cgit v1.2.3