Redmine Refactor #135: Extract Method page_index in WikiController#special

With the #load_pages_grouped_by_date_without_content method extracted in WikiController#special from yesterday, I can now get back to splitting up #special.

Before

1
2
3
4
5
6
7
8
9
10
class WikiController  'export', :id => @project # Compatibility stub while refactoring
      return
    else
      # requested special page doesn't exist, redirect to default page
      redirect_to :action => 'index', :id => @project, :page => nil
      return
    end
    render :action => "special_#{page_title}"
  end
end

After

1
2
3
4
5
6
7
8
9
10
11
12
13
14
class WikiController  'export', :id => @project # Compatibility stub while refactoring
      return
    else
      # requested special page doesn't exist, redirect to default page
      redirect_to :action => 'index', :id => @project, :page => nil
      return
    end
    render :action => "special_#{page_title}"
  end
 
  def page_index
    load_pages_grouped_by_date_without_content
  end
end

This extract method removed another branch from #special‘s case statement. Once I extract the date_index branch, I should be almost done with #special.

Reference commit