Last active
August 29, 2015 14:18
-
-
Save phantomwhale/7c1b0a8a119fce7d24bf to your computer and use it in GitHub Desktop.
Revisions
-
phantomwhale revised this gist
Apr 2, 2015 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,9 @@ class << self include Rails.application.routes.url_helpers end module_function def static_pages Dir.entries(Rails.root.join('app', 'views', 'pages')).inject([]) do |pages, file| matches = file.match(/\.html\.[a-z]+$/) next pages if matches.nil? -
phantomwhale created this gist
Apr 2, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ module HighVoltagePagesHelper class << self include Rails.application.routes.url_helpers end def self.static_pages Dir.entries(Rails.root.join('app', 'views', 'pages')).inject([]) do |pages, file| matches = file.match(/\.html\.[a-z]+$/) next pages if matches.nil? filename = file.sub(matches[0], "") title = filename.titleize path = page_path(filename) pages.push(title: title, path: path) end end end