Class: Junebug::Controllers::Show

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

Instance Method Summary collapse

Instance Method Details

#get(page_name, version = nil) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/junebug/controllers.rb', line 13

def get page_name, version = nil
  @page_title = page_name
  #redirect(Edit, page_name, 1) and return unless @page = Page.find_by_title(page_name)
  redirect("#{Junebug.config['url']}/#{page_name.gsub(/ /,'+')}/1/edit") and return unless @page = Page.find_by_title(page_name)
  @version = (version.nil? or version == @page.version.to_s) ? @page : @page.versions.find_by_version(version)
  render :show
end