Orbit/app/controllers/admin/user_attribute_models_contr...

49 lines
1.2 KiB
Ruby

class Admin::UserAttributeModelsController < ApplicationController
layout "admin"
before_filter :authenticate_user!
before_filter :is_admin?
def index
@user_attribute_models = UserAttributeModel.all.entries
end
def show
@user_attribute_model = UserAttributeModel.find(params[:id])
end
def new
@user_attribute_model = UserAttributeModel.new
session[:last_page] = get_go_back || admin_user_attribute_models_url
end
def edit
@user_attribute_model = UserAttributeModel.find(params[:id])
@i18n_variable = @user_attribute_model.i18n_variable
session[:last_page] = get_go_back || admin_user_attribute_models_url
end
def create
@user_attribute_model = UserAttributeModel.new(params[:user_attribute_model])
@user_attribute_model.save
redirect_to :action => :index
end
def update
@user_attribute_model = UserAttributeModel.find(params[:id])
@user_attribute_model.update_attributes(params[:user_attribute_model])
redirect_to :action => :index
end
def destroy
@user_attribute_model = UserAttributeModel.find(params[:id])
@user_attribute_model.destroy
@user_attribute_model.destroy_i18n_variables
redirect_to :action => :index
end
end