Sha256: 5cf84374e8056061b70b653dd26a5bea220984295371f67d256f9ec076da41e4
Contents?: true
Size: 1.56 KB
Versions: 1
Compression:
Stored size: 1.56 KB
Contents
module Doorkeeper class ApplicationsController < Doorkeeper::ApplicationController respond_to :html before_filter :authenticate_admin! def index @applications = Application.find_all end def new @application = Application.new end def create @application = Application.new(application_params) if @application.save flash[:notice] = I18n.t(:notice, :scope => [:doorkeeper, :flash, :applications, :create]) p @application respond_with [:oauth, @application] else render :new end end def show @application = Application.find(params[:id]) end def edit @application = Application.find(params[:id]) end def update @application = Application.find(params[:id]) if @application.update_attributes(application_params) flash[:notice] = I18n.t(:notice, :scope => [:doorkeeper, :flash, :applications, :update]) respond_with [:oauth, @application] else render :edit end end def destroy @application = Application.find(params[:id]) flash[:notice] = I18n.t(:notice, :scope => [:doorkeeper, :flash, :applications, :destroy]) if @application.delete redirect_to oauth_applications_url end private def application_params if params.respond_to?(:permit) params.require(:application).permit(:name, :redirect_uri) else params[:application].slice(:name, :redirect_uri) rescue nil end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
couchkeeper-0.6.7 | app/controllers/doorkeeper/applications_controller.rb |