Sha256: ce0201acc84daf6a332f1776205b81b57924c03fbbf696de09ebb88d0108416e
Contents?: true
Size: 488 Bytes
Versions: 9
Compression:
Stored size: 488 Bytes
Contents
module HighVoltage module Constraints # Routing constraint to validate request.path has a corresponding view class RootRoute def self.matches?(request) pattern = file_pattern(request.path) Dir.glob(pattern).any? end private def self.file_pattern(page_id) "#{content_path}#{page_id}.html*" end def self.content_path Rails.root.join('app', 'views', HighVoltage.content_path).to_s end end end end
Version data entries
9 entries across 9 versions & 1 rubygems