Commit ea59d93d authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Dry Users API responders.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4454 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent e9775097
......@@ -49,8 +49,7 @@ class UsersController < ApplicationController
respond_to do |format|
format.html { render :layout => !request.xhr? }
format.json { render :template => 'users/index.apit' }
format.xml { render :template => 'users/index.apit' }
format.api { render :template => 'users/index.apit' }
end
end
......@@ -72,8 +71,7 @@ class UsersController < ApplicationController
respond_to do |format|
format.html { render :layout => 'base' }
format.json { render :template => 'users/show.apit' }
format.xml { render :template => 'users/show.apit' }
format.api { render :template => 'users/show.apit' }
end
rescue ActiveRecord::RecordNotFound
render_404
......@@ -116,8 +114,7 @@ class UsersController < ApplicationController
{:controller => 'users', :action => 'edit', :id => @user}
)
}
format.json { render :template => 'users/show.apit', :status => :created, :location => user_url(@user) }
format.xml { render :template => 'users/show.apit', :status => :created, :location => user_url(@user) }
format.api { render :template => 'users/show.apit', :status => :created, :location => user_url(@user) }
end
else
@auth_sources = AuthSource.find(:all)
......@@ -175,8 +172,7 @@ class UsersController < ApplicationController
flash[:notice] = l(:notice_successful_update)
redirect_to :back
}
format.json { head :ok }
format.xml { head :ok }
format.api { head :ok }
end
else
@auth_sources = AuthSource.find(:all)
......
......@@ -92,3 +92,13 @@ module I18n
end
end
end
module ActionController
module MimeResponds
class Responder
def api(&block)
any(:xml, :json, &block)
end
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment