From 46ad09bf70400eeebab5495ee6a5ded4da86012e Mon Sep 17 00:00:00 2001 From: GitLab Date: Tue, 11 Feb 2014 19:04:47 +0530 Subject: code refactor as per standards --- app/controllers/profiles/keys_controller.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'app/controllers/profiles') diff --git a/app/controllers/profiles/keys_controller.rb b/app/controllers/profiles/keys_controller.rb index 7c97987d006..e8237a1f227 100644 --- a/app/controllers/profiles/keys_controller.rb +++ b/app/controllers/profiles/keys_controller.rb @@ -34,14 +34,17 @@ class Profiles::KeysController < ApplicationController end end - #get all keys of a user(params[:username]) in a text format - #helpful for sysadmins to put in respective servers + # Get all keys of a user(params[:username]) in a text format + # Helpful for sysadmins to put in respective servers def get_keys if params[:username].present? begin user = User.find_by_username(params[:username]) - user.present? ? (render :text => user.all_ssh_keys.join('\n')) : - (render_404 and return) + if user.present? + render text: user.all_ssh_keys.join('\n') + else + render_404 and return + end rescue => e render text: e.message end -- cgit v1.2.1