From c5f30fde28723ebb6b2f9598ed2f8721287200f0 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Mon, 15 Feb 2010 16:41:21 +0000 Subject: [PATCH] Refactor: Merged AuthSourcesController#list and #index git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3436 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/auth_sources_controller.rb | 17 ++++++----------- app/views/auth_sources/{list.rhtml => index.html.erb} | 0 app/views/settings/_authentication.rhtml | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) rename app/views/auth_sources/{list.rhtml => index.html.erb} (100%) diff --git a/app/controllers/auth_sources_controller.rb b/app/controllers/auth_sources_controller.rb index 0f5fba14..eaedb5ba 100644 --- a/app/controllers/auth_sources_controller.rb +++ b/app/controllers/auth_sources_controller.rb @@ -20,18 +20,13 @@ class AuthSourcesController < ApplicationController before_filter :require_admin - def index - list - render :action => 'list' unless request.xhr? - end - # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html) verify :method => :post, :only => [ :destroy, :create, :update ], :redirect_to => { :action => :list } - def list + def index @auth_source_pages, @auth_sources = paginate :auth_sources, :per_page => 10 - render :action => "list", :layout => false if request.xhr? + render :action => "index", :layout => false if request.xhr? end def new @@ -42,7 +37,7 @@ class AuthSourcesController < ApplicationController @auth_source = AuthSourceLdap.new(params[:auth_source]) if @auth_source.save flash[:notice] = l(:notice_successful_create) - redirect_to :action => 'list' + redirect_to :action => 'index' else render :action => 'new' end @@ -56,7 +51,7 @@ class AuthSourcesController < ApplicationController @auth_source = AuthSource.find(params[:id]) if @auth_source.update_attributes(params[:auth_source]) flash[:notice] = l(:notice_successful_update) - redirect_to :action => 'list' + redirect_to :action => 'index' else render :action => 'edit' end @@ -70,7 +65,7 @@ class AuthSourcesController < ApplicationController rescue => text flash[:error] = "Unable to connect (#{text})" end - redirect_to :action => 'list' + redirect_to :action => 'index' end def destroy @@ -79,6 +74,6 @@ class AuthSourcesController < ApplicationController @auth_source.destroy flash[:notice] = l(:notice_successful_delete) end - redirect_to :action => 'list' + redirect_to :action => 'index' end end diff --git a/app/views/auth_sources/list.rhtml b/app/views/auth_sources/index.html.erb similarity index 100% rename from app/views/auth_sources/list.rhtml rename to app/views/auth_sources/index.html.erb diff --git a/app/views/settings/_authentication.rhtml b/app/views/settings/_authentication.rhtml index eb51ee9f..81814bba 100644 --- a/app/views/settings/_authentication.rhtml +++ b/app/views/settings/_authentication.rhtml @@ -20,7 +20,7 @@
- <%= link_to l(:label_ldap_authentication), :controller => 'auth_sources', :action => 'list' %> + <%= link_to l(:label_ldap_authentication), :controller => 'auth_sources', :action => 'index' %>
<%= submit_tag l(:button_save) %> -- 2.11.0