Class: WikisController

Inherits:
ApplicationController show all
Defined in:
app/controllers/wikis_controller.rb

Overview

– copyright ChiliProject is a project management system.

Copyright (C) 2010-2013 the ChiliProject Team

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

See doc/COPYRIGHT.rdoc for more details. ++

Instance Method Summary collapse

Methods included from Redmine::MenuManager::MenuController

#current_menu_item, included, #menu_items, #redirect_to_project_menu_item

Methods included from Redmine::Search::Controller

#default_search_scope, #default_search_scopes, included

Methods included from Redmine::I18n

#current_language, #day_name, #find_language, #format_date, #format_time, included, #l, #l_hours, #l_or_humanize, #ll, #month_name, #set_language_if_valid, #valid_languages

Instance Method Details

#destroyObject

Delete a project's wiki


28
29
30
31
32
33
# File 'app/controllers/wikis_controller.rb', line 28

def destroy
  if request.post? && params[:confirm] && @project.wiki
    @project.wiki.destroy
    redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'wiki'
  end
end

#editObject

Create or update a project's wiki


20
21
22
23
24
25
# File 'app/controllers/wikis_controller.rb', line 20

def edit
  @wiki = @project.wiki || Wiki.new(:project => @project)
  @wiki.safe_attributes = params[:wiki]
  @wiki.save if request.post?
  render(:update) {|page| page.replace_html "tab-content-wiki", :partial => 'projects/settings/wiki'}
end