Wiki: history
This commit is contained in:
parent
b565cd1972
commit
85974948e7
7 changed files with 41 additions and 4 deletions
|
@ -4,7 +4,11 @@ class WikisController < ApplicationController
|
|||
layout "project"
|
||||
|
||||
def show
|
||||
@wiki = @project.wikis.where(:slug => params[:id]).order("created_at").last
|
||||
if params[:old_page_id]
|
||||
@wiki = @project.wikis.find(params[:old_page_id])
|
||||
else
|
||||
@wiki = @project.wikis.where(:slug => params[:id]).order("created_at").last
|
||||
end
|
||||
respond_to do |format|
|
||||
if @wiki
|
||||
format.html
|
||||
|
@ -22,6 +26,7 @@ class WikisController < ApplicationController
|
|||
|
||||
def create
|
||||
@wiki = @project.wikis.new(params[:wiki])
|
||||
@wiki.user = current_user
|
||||
|
||||
respond_to do |format|
|
||||
if @wiki.save
|
||||
|
@ -31,6 +36,10 @@ class WikisController < ApplicationController
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
def history
|
||||
@wikis = @project.wikis.where(:slug => params[:id]).order("created_at")
|
||||
end
|
||||
|
||||
def destroy
|
||||
@wiki = @project.wikis.find(params[:id])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue