summaryrefslogtreecommitdiff
path: root/users/app/controllers
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2013-12-02 11:56:04 -0800
committerjessib <jessib@riseup.net>2013-12-02 11:56:04 -0800
commit2a2ffd46bf4e6009f2957fb4e4abdedbfa7e3245 (patch)
tree41dd790266aaa951dfa35889527f78015f8c4451 /users/app/controllers
parent8e9b65b01bbd9d44d4077d94f2dc4ac375cf8e85 (diff)
parent8de6f143e53af5287b41913dcf3c7969f452fbc9 (diff)
Merge branch 'develop' into feature/service_level
Diffstat (limited to 'users/app/controllers')
-rw-r--r--users/app/controllers/keys_controller.rb12
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