Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10543: markaby_fix.diff

File markaby_fix.diff, 1.7 kB (added by rubyruy, 8 months ago)
  • vendor/plugins/markaby/lib/markaby/rails.rb

    old new  
    1 module ActionView # :nodoc: 
    2   class Base # :nodoc: 
    3     def render_template(template_extension, template, file_path = nil, local_assigns = {}) 
    4       if handler = @@template_handlers[template_extension] 
    5         template ||= read_template_file(file_path, template_extension) 
    6         handler.new(self).render(template, local_assigns, file_path) 
    7       else 
    8         compile_and_render_template(template_extension, template, file_path, local_assigns) 
    9       end 
    10     end 
    11   end 
    12 end 
     1# module ActionView # :nodoc: 
     2#   class Base # :nodoc: 
     3#     def render_template(template_extension, template, file_path = nil, local_assigns = {}) 
     4#       if handler = @@template_handlers[template_extension] 
     5#         template ||= read_template_file(file_path, template_extension) 
     6#         handler.new(self).render(template, local_assigns, file_path) 
     7#       else 
     8#         compile_and_render_template(@@template_handlers[template_extension.to_sym], template, file_path, local_assigns) 
     9#       end 
     10#     end 
     11#   end 
     12# end 
    1313 
    1414module Markaby 
    1515  module Rails 
     
    2828      def initialize(action_view) 
    2929        @action_view = action_view 
    3030      end 
    31       def render(template, local_assigns, file_path
     31      def render(template, local_assigns, file_path=nil
    3232        template = Template.new(template) 
    3333        template.path = file_path 
    3434        template.render(@action_view.assigns.merge(local_assigns), @action_view)