Fixed HTML export to work with current Rails (the implementation uses some non-public Rails methods, and since some point Rails 'forgot' to use layout in there)

This commit is contained in:
Alexey Verkhovsky 2005-05-02 00:51:37 +00:00
parent e20e529960
commit ee396a3237
2 changed files with 12 additions and 7 deletions

View file

@ -1,7 +1,12 @@
* SVN trunk:
Handling of line breaks in Textile is as in 0.9 (inserts <br/> tag).
* 0.10.1:
Upgraded Rails to 0.12.0
Upgraded rubyzip to version 0.5.8
BlueCloth is back (RedCloth didn't do pure Markdown well enough to replace it yet)
Handling of line breaks in Textile is as in 0.9 (inserts <br/> tag)
Fixed HTML export (to enclose the output in <html> tags, include the stylesheet etc)
Some other bug fixes
* 0.10.0:
Ported to ActionPack
RedCloth 3.0.3

View file

@ -49,7 +49,7 @@ class WikiController < ApplicationController
export_pages_as_zip('html') do |page|
@page = page
@link_mode = :export
render_to_string 'wiki/print'
render_to_string('wiki/print', use_layout = true)
end
end
@ -336,11 +336,11 @@ class WikiController < ApplicationController
end
end
def render_to_string(template_name)
def render_to_string(template_name, with_layout = false)
add_variables_to_assigns
render template_name
@performed_render = false
@template.render_file(template_name)
@content_for_layout = @template.render_file(template_name)
if with_layout then @template.render_file('layouts/default');
else @content_for_layout; end
end
def rss_with_content_allowed?