Class: Junebug::Controllers::Diff

Inherits:
R
  • Object
show all
Includes:
HTMLDiff
Defined in:
lib/junebug/controllers.rb

Instance Method Summary collapse

Methods included from HTMLDiff

#diff

Instance Method Details

#get(page_name, v1, v2) ⇒ Object



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/junebug/controllers.rb', line 109

def get page_name, v1, v2
  @page_title = "Diff: #{page_name}"
  @page = Page.find_by_title(page_name)    
  @v1 = @page.find_version(v1)
  @v2 = @page.find_version(v2)
  
  #@v1_markup = ( @v1.body ? _markup( @v1.body ) : '' )
  #@v2_markup = ( @v2.body ? _markup( @v2.body ) : '' )
  @v1_markup = @v1.body || ''
  @v2_markup = @v2.body || ''
  
  @difftext = diff( @v1_markup , @v2_markup)
  
  render :diff
end