diff options
author | elijah <elijah@riseup.net> | 2012-12-07 11:45:48 -0800 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2012-12-07 11:45:48 -0800 |
commit | 01acd4bb0126080bdb58b616765fe40a7df571e9 (patch) | |
tree | 29c410b5ebe6f92814c7d3653cb1cfb4d6495d87 /app | |
parent | caadadd3b7f2735d95bb02f935346f6044e05049 (diff) |
add support for external links
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/application_helper.rb | 5 |
1 files changed, 4 insertions, 1 deletions
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 |