Sha256: e24ff3b2bc7879785132cf429864f8696e64bfa394182212c13c715b43e6a4b8

Contents?: true

Size: 902 Bytes

Versions: 13

Compression:

Stored size: 902 Bytes

Contents

module ActionView
  module TemplateRendererPatch
    def self.included base
      base.class_eval do
        alias_method :original_render, :render

        def render(context, options)
          @view = context
          @details = extract_details(options)
          extract_format(options[:file] || options[:template], @details)
          template = determine_template(options)
          context = @lookup_context

          unless context.rendered_format
            context.formats = template.formats unless template.formats.empty?
            context.rendered_format = context.formats.first
          end

          layout = template.layout if template.respond_to?(:layout)
          layout ||= options[:layout]

          render_template(template, layout, options[:locals])
        end
      end
    end
  end
end


ActionView::TemplateRenderer.send(:include, ActionView::TemplateRendererPatch)

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ecm_cms-1.0.5.pre lib/ecm/cms/action_view/template_renderer_patch.rb
ecm_cms-1.0.4.pre lib/ecm/cms/action_view/template_renderer_patch.rb
ecm_cms-1.0.3.pre lib/ecm/cms/action_view/template_renderer_patch.rb
ecm_cms-1.0.2.pre lib/ecm/cms/action_view/template_renderer_patch.rb
ecm_cms-1.0.1.pre lib/ecm/cms/action_view/template_renderer_patch.rb
ecm_cms-1.0.0.pre lib/ecm/cms/action_view/template_renderer_patch.rb
ecm_cms-0.0.13.pre lib/ecm/cms/action_view/template_renderer_patch.rb
ecm_cms-0.0.11.pre lib/ecm/cms/action_view/template_renderer_patch.rb
ecm_cms-0.0.10.pre lib/ecm/cms/action_view/template_renderer_patch.rb
ecm_cms-0.0.8.pre lib/ecm/cms/action_view/template_renderer_patch.rb
ecm_cms-0.0.7.pre lib/ecm/cms/action_view/template_renderer_patch.rb
ecm_cms-0.0.6.pre lib/ecm/cms/action_view/template_renderer_patch.rb
ecm_cms-0.0.5.pre lib/ecm/cms/action_view/template_renderer_patch.rb