Admin can new/edit user_attributes

This commit is contained in:
Wen-Tien Chang committed 2010-03-15 17:35:01 +08:00
1 parent 263da6aa9f
commit bebc51e8bb
9 files changed
+145 -1

No files matched your search

@@ -0,0 +1,43 @@
class Admin::UserAttributesController < ApplicationController
layout "admin"
before_filter :authenticate_user!
def index
@user_attributes = UserAttribute.all
end
def show
@user_attribute = UserAttribute.find(params[:id])
end
def new
@user_attribute = UserAttribute.new
end
def edit
@user_attribute = UserAttribute.find(params[:id])
end
def create
@user_attribute = UserAttribute.new(params[:user_attribute])
@user_attribute.save
redirect_to :action => :index
end
def update
@user_attribute = UserAttribute.find(params[:id])
@user_attribute.update_attributes(params[:user_attribute])
redirect_to :action => :index
end
def destroy
@user_attribute = UserAttribute.find(params[:id])
@user_attribute.destroy
redirect_to :action => :index
end
end