diff options
| author | gitlabhq <m@gitlabhq.com> | 2011-10-09 00:36:38 +0300 | 
|---|---|---|
| committer | gitlabhq <m@gitlabhq.com> | 2011-10-09 00:36:38 +0300 | 
| commit | 9ba1224867665844b117fa037e1465bb706b3685 (patch) | |
| tree | 52fbfc1cdb55df21843965479c97be0c91121a9a /app/controllers/keys_controller.rb | |
| parent | 93efff945215a4407afcaf0cba15ac601b56df0d (diff) | |
| download | gitlab-ce-9ba1224867665844b117fa037e1465bb706b3685.tar.gz | |
init commit
Diffstat (limited to 'app/controllers/keys_controller.rb')
| -rw-r--r-- | app/controllers/keys_controller.rb | 38 | 
1 files changed, 38 insertions, 0 deletions
diff --git a/app/controllers/keys_controller.rb b/app/controllers/keys_controller.rb new file mode 100644 index 00000000000..003de6b301a --- /dev/null +++ b/app/controllers/keys_controller.rb @@ -0,0 +1,38 @@ +class KeysController < ApplicationController +  respond_to :js + +  def index +    @keys = current_user.keys.all + +    respond_to do |format| +      format.html # index.html.erb +      format.json { render json: @keys } +    end +  end + +  def new +    @key = current_user.keys.new + +    respond_with(@key) +  end + +  def create +    @key = current_user.keys.new(params[:key]) +    @key.save + +    respond_with(@key) +  end + +  # DELETE /keys/1 +  # DELETE /keys/1.json +  def destroy +    @key = current_user.keys.find(params[:id]) +    @key.destroy + +    respond_to do |format| +      format.html { redirect_to keys_url } +      format.js { render :nothing => true }   +      format.json { head :ok } +    end +  end +end  | 
