orbit-basic/app/controllers/admin/user_attribute_models_contr...

49 lines
1.1 KiB
Ruby
Raw Normal View History

2011-02-01 02:46:26 +00:00
class Admin::UserRoleModelsController < ApplicationController
layout "admin"
before_filter :authenticate_user!
before_filter :is_admin?
def index
2011-02-01 02:46:26 +00:00
@user_role_models = UserRoleModel.all.entries
end
def show
2011-02-01 02:46:26 +00:00
@user_role_model = UserRoleModel.find(params[:id])
end
def new
2011-02-01 02:46:26 +00:00
@user_role_model = UserRoleModel.new
session[:last_page] = get_go_back || admin_user_role_models_url
end
def edit
2011-02-01 02:46:26 +00:00
@user_role_model = UserRoleModel.find(params[:id])
@i18n_variable = @user_role_model.i18n_variable
session[:last_page] = get_go_back || admin_user_role_models_url
end
def create
2011-02-01 02:46:26 +00:00
@user_role_model = UserRoleModel.new(params[:user_role_model])
@user_role_model.save
redirect_to :action => :index
end
def update
2011-02-01 02:46:26 +00:00
@user_role_model = UserRoleModel.find(params[:id])
@user_role_model.update_attributes(params[:user_role_model])
redirect_to :action => :index
end
def destroy
2011-02-01 02:46:26 +00:00
@user_role_model = UserRoleModel.find(params[:id])
@user_role_model.destroy
2011-02-01 02:46:26 +00:00
@user_role_model.destroy_i18n_variables
redirect_to :action => :index
end
end