fixed the render_to_string hack to live peasefully with the new ActionPack rule that "the first render wins"

This commit is contained in:
Alexey Verkhovsky 2005-01-21 21:06:46 +00:00
parent 26974db864
commit 9242ad045d

View file

@ -317,7 +317,7 @@ class WikiController < ApplicationController
end end
FileUtils.rm_rf(Dir[WikiService.storage_path + file_prefix + '*.zip']) FileUtils.rm_rf(Dir[WikiService.storage_path + file_prefix + '*.zip'])
FileUtils.mv(tmp_path, file_path) FileUtils.mv(tmp_path, file_path)
send_file(file_path, :type => 'application/zip', :streaming => false) send_file(file_path, :type => 'application/zip')
end end
def export_web_to_tex(file_path) def export_web_to_tex(file_path)
@ -399,11 +399,12 @@ class WikiController < ApplicationController
def render_to_string(template_name) def render_to_string(template_name)
add_variables_to_assigns add_variables_to_assigns
render template_name render template_name
@performed_render = false
@template.render_file(template_name) @template.render_file(template_name)
end end
def template_engine(template_name) def template_engine(template_name)
ERB.new(IO.readlines(RAILS_ROOT + '/app/views/wiki/' + template_name + '.rhtml').join) ERB.new(IO.readlines(RAILS_ROOT + '/app/views/' + template_name + '.rhtml').join)
end end
def truncate(text, length = 30, truncate_string = '...') def truncate(text, length = 30, truncate_string = '...')