mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-05-30 16:30:59 +00:00
Purged git history and removed sensitive information.
This commit is contained in:
commit
8ed526716f
857 changed files with 25312 additions and 0 deletions
32
app/controllers/versions_controller.rb
Normal file
32
app/controllers/versions_controller.rb
Normal file
|
@ -0,0 +1,32 @@
|
|||
class VersionsController < ApplicationController
|
||||
before_filter :get_article
|
||||
|
||||
def index
|
||||
@versions = @article.versions
|
||||
render "articles/history"
|
||||
end
|
||||
|
||||
def show
|
||||
@version = @article.versions.find params[:id]
|
||||
@nobody = true
|
||||
render "articles/version"
|
||||
end
|
||||
|
||||
def update
|
||||
raise AccessError unless @article.can_update? cuser
|
||||
@version = @article.versions.find params[:id]
|
||||
@nobody = true
|
||||
|
||||
if @article.revert_to! @version.version
|
||||
flash[:notice] = t(:articles_revert, :version => @version.version)
|
||||
end
|
||||
|
||||
redirect_to @article
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def get_article
|
||||
@article = Article.find(params[:article_id])
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue