You are here: Home > Latest news from Darcs > Fixes wiki page rendering broken by a premature optimization

Revision 20080620210814-9043f-96b0af...

Fixes wiki page rendering broken by a premature optimization

Premature optimization really is the root of all evil

app/helpers/application_helper.rb

Changes to application_helper.rb

37
  
  
37
38
  def pagetext(title, revision=nil, &block)
  def pagetext(title, revision=nil, &block)
38
39
    content = capture(&block)
    content = capture(&block)
39
40
    xml = b.div(:class => 'pagetext') do
    xml = b.div(:class => 'pagetext') do |b|
40
41
      b.a(:href => url_for(:controller => 'wiki', :action => 'history',
      b.a(:href => url_for(:controller => 'wiki', :action => 'history',
41
42
                           :page_name => @page.name, :locale => @locale,
                           :page_name => @page.name, :locale => @locale,
42
43
                           :format => 'xml'),
                           :format => 'xml'),
43
75 more lines
119
private
private
119
120
120
121
  def b
  def b
121
122
    @markup ||= Builder::XmlMarkup.new
    Builder::XmlMarkup.new
122
123
  end
  end
123
124
124
125
end
end
125