summaryrefslogtreecommitdiff
path: root/users/app/controllers/keys_controller.rb
blob: 949f2c0f66978ab695d6018dd1161d2c8eaa80d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
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