Sha256: 7daed3a8e022d4496dc274c91bded5a603f7c51f2f017d917272458da2117fbc
Contents?: true
Size: 372 Bytes
Versions: 5
Compression:
Stored size: 372 Bytes
Contents
module NavigationHelpers def path_to(page_name) case page_name when 'the homepage' root_path when /^the ([\w ]+) page$/ send("#{$1.gsub(/\W+/, '_')}_path") when /^"(\/.*)"/ $1 else raise "Can't find mapping from \"#{page_name}\" to a path." end end end World do |world| world.extend NavigationHelpers world end
Version data entries
5 entries across 5 versions & 3 rubygems