2011-10-08 23:36:38 +02:00
|
|
|
class KeysController < ApplicationController
|
2011-11-02 16:21:17 +01:00
|
|
|
layout "profile"
|
2012-01-29 22:59:12 +01:00
|
|
|
respond_to :js, :html
|
2011-10-08 23:36:38 +02:00
|
|
|
|
|
|
|
def index
|
|
|
|
@keys = current_user.keys.all
|
|
|
|
end
|
|
|
|
|
2011-12-19 22:32:59 +01:00
|
|
|
def show
|
|
|
|
@key = current_user.keys.find(params[:id])
|
|
|
|
end
|
|
|
|
|
2011-10-08 23:36:38 +02:00
|
|
|
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
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
@key = current_user.keys.find(params[:id])
|
|
|
|
@key.destroy
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
format.html { redirect_to keys_url }
|
2011-10-26 15:46:25 +02:00
|
|
|
format.js { render :nothing => true }
|
2011-10-08 23:36:38 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|