From 4b045badcfde2eb27b63023ca8f3c30334d7f00f Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Mon, 25 Oct 2010 16:16:46 +0000 Subject: 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 --- app/controllers/wiki_controller.rb | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'app/controllers/wiki_controller.rb') 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 -- cgit v1.2.3