Class: Junebug::Controllers::Revert

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

Instance Method Summary collapse

Instance Method Details

#get(page_name, version) ⇒ Object



66
67
68
69
70
# File 'lib/junebug/controllers.rb', line 66

def get page_name, version
  redirect("#{Junebug.config['url']}/login") and return unless logged_in?
  Page.find_by_title(page_name).revert_to!(version) if is_admin?
  redirect "#{Junebug.config['url']}/#{page_name.gsub(/ /,'+')}"
end