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



93
94
95
96
97
# File 'lib/junebug/controllers.rb', line 93

def get page_name, version
  redirect("/login") and return unless logged_in? # shouldn't be here
  Page.find_by_title(page_name.gsub(/_/,' ')).revert_to!(version) if is_admin?
  redirect Show, page_name
end