summaryrefslogtreecommitdiffstats
path: root/app/controllers/wiki_controller.rb
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-10-25 16:16:46 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-10-25 16:16:46 +0000
commit4b045badcfde2eb27b63023ca8f3c30334d7f00f (patch)
treef79e433aea72c3b42f50065a26ffd6da535d229f /app/controllers/wiki_controller.rb
parent0e951c071631fee35962b264d3db2c68961bf670 (diff)
downloadredmine-4b045badcfde2eb27b63023ca8f3c30334d7f00f.tar.gz
redmine-4b045badcfde2eb27b63023ca8f3c30334d7f00f.zip
Refactor: Rename WikiController#page_index to #index
index is the action that should list a collection of records, which is what #page_index does. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4290 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/wiki_controller.rb')
-rw-r--r--app/controllers/wiki_controller.rb25
1 files changed, 20 insertions, 5 deletions
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb
index 1c42ab5cd..c7b866239 100644
--- a/app/controllers/wiki_controller.rb
+++ b/app/controllers/wiki_controller.rb
@@ -17,6 +17,20 @@
require 'diff'
+# The WikiController follows the Rails REST controller pattern but with
+# a few differences
+#
+# * index - shows a list of WikiPages grouped by page or date
+# * new - not used
+# * create - not used
+# * show - will also show the form for creating a new wiki page
+# * edit - used to edit an existing or new page
+# * update - used to save a wiki page update to the database, including new pages
+# * destroy - normal
+#
+# Other member and collection methods are also used
+#
+# TODO: still being worked on
class WikiController < ApplicationController
default_search_scope :wiki_pages
before_filter :find_wiki, :authorize
@@ -28,6 +42,11 @@ class WikiController < ApplicationController
include AttachmentsHelper
helper :watchers
+ # List of pages, sorted alphabetically and by parent (hierarchy)
+ def index
+ load_pages_grouped_by_date_without_content
+ end
+
# display a page (in editing mode if it doesn't exist)
def show
page_title = params[:page]
@@ -180,7 +199,7 @@ class WikiController < ApplicationController
end
end
@page.destroy
- redirect_to :action => 'page_index', :project_id => @project
+ redirect_to :action => 'index', :project_id => @project
end
# Export wiki to a single html file
@@ -194,10 +213,6 @@ class WikiController < ApplicationController
end
end
- def page_index
- load_pages_grouped_by_date_without_content
- end
-
def date_index
load_pages_grouped_by_date_without_content
end