Sha256: 003328045044eba9bad014721c3b606be05fbb71df3b1401702a5fff1d06929c
Contents?: true
Size: 665 Bytes
Versions: 12
Compression:
Stored size: 665 Bytes
Contents
class PageletRails::Router def self.load_routes! context controllers = Dir[Rails.root.join('app', 'pagelets', '*', '*controller.rb')] controllers.each do |controller_file| pagelet_name = File.basename(File.dirname(controller_file)) basename_controller_name = File.basename controller_file, '.rb' controller = "#{pagelet_name}/#{basename_controller_name}".camelize.constantize next unless controller.respond_to? :load_pagelet_routes! context.instance_eval do scope module: pagelet_name, path: "/pagelets", as: "pagelets" do controller.load_pagelet_routes! self end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems