if @client_application.save
flash[:notice] = t "oauth_clients.create.flash"
redirect_to :action => "show", :id => @client_application.id
if @client_application.save
flash[:notice] = t "oauth_clients.create.flash"
redirect_to :action => "show", :id => @client_application.id
rescue ActiveRecord::RecordNotFound
@type = "client application"
render :action => "not_found", :status => :not_found
end
def edit
rescue ActiveRecord::RecordNotFound
@type = "client application"
render :action => "not_found", :status => :not_found
end
def edit
rescue ActiveRecord::RecordNotFound
@type = "client application"
render :action => "not_found", :status => :not_found
end
def update
rescue ActiveRecord::RecordNotFound
@type = "client application"
render :action => "not_found", :status => :not_found
end
def update
- @client_application = @user.client_applications.find(params[:id])
- if @client_application.update_attributes(application_params)
+ @client_application = current_user.client_applications.find(params[:id])
+ if @client_application.update(application_params)
flash[:notice] = t "oauth_clients.update.flash"
redirect_to :action => "show", :id => @client_application.id
else
flash[:notice] = t "oauth_clients.update.flash"
redirect_to :action => "show", :id => @client_application.id
else
@client_application.destroy
flash[:notice] = t "oauth_clients.destroy.flash"
redirect_to :action => "index"
@client_application.destroy
flash[:notice] = t "oauth_clients.destroy.flash"
redirect_to :action => "index"