diff options
author | azul <azul@riseup.net> | 2013-11-25 13:12:20 -0800 |
---|---|---|
committer | azul <azul@riseup.net> | 2013-11-25 13:12:20 -0800 |
commit | 21cc6313320efa2992a58b7434468678ca6cf3b6 (patch) | |
tree | 13f878e171d1cbbbcc82f5e40c91db145017efb2 /users/app | |
parent | 19eac22510fcb4ad74456cc3872196fa1e63a93d (diff) | |
parent | 299dfdf4164ee10de63aa2543935eeed65437b3f (diff) |
Merge pull request #117 from jessib/feature/return_public_key
Feature/return public key
Diffstat (limited to 'users/app')
-rw-r--r-- | users/app/controllers/keys_controller.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/users/app/controllers/keys_controller.rb b/users/app/controllers/keys_controller.rb new file mode 100644 index 0000000..949f2c0 --- /dev/null +++ b/users/app/controllers/keys_controller.rb @@ -0,0 +1,12 @@ +class KeysController < ApplicationController + + def show + user = User.find_by_login(params[:login]) + # layout won't be included if we render text + # we will show blank page if user doesn't have key (which shouldn't generally occur) + # and a 404 error if user doesn't exist + user ? (render text: user.public_key) : (raise ActionController::RoutingError.new('Not Found')) + + end + +end |