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