require 'singleton' class PagesController < ApplicationController class IntegrationsResolver < ActionView::Resolver include Singleton # Follow convention when using this! # Actually, you, dear user, really # should have no reason for changing # the code here at all since it will be # autogenerated for you for testing purposes def find_templates(name, prefix, partial, details) if partial identifier = "#{prefix}-#{name}" p_name = name.split "/" p_name.push("_" + p_name.pop) f_path = File.join( File.expand_path("../../../../assets/html", File.dirname(__FILE__)), p_name.join("/") ) throw "#{name}--#{prefix}--#{partial}--#{details}--#{f_path}" unless File.exist?( f_path + ".html.haml") source = File.read f_path + ".html.haml" handler = ActionView::Template.registered_template_handler("haml") details = { :format => Mime[:html] , :updated_at => 1.seconds.ago , :virtual_path => f_path } [ActionView::Template::new( source, identifier, handler, details )] else [] end end end append_view_path IntegrationsResolver.instance def index; end end